]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
if: Remove unnecessary validation in the SIOCSIFNAME handler
authorMark Johnston <markj@FreeBSD.org>
Wed, 12 May 2021 14:05:37 +0000 (10:05 -0400)
committerMark Johnston <markj@FreeBSD.org>
Wed, 19 May 2021 13:32:11 +0000 (09:32 -0400)
commit178633e28291d2e4168e51e6d970c25bca43bc1e
treefbb5c75ffc5a64bd2285316bfe1116ca0ec50016
parenteea4a0b81aedfdbb80245e779c92a74131c572aa
if: Remove unnecessary validation in the SIOCSIFNAME handler

A successful copyinstr() call guarantees that the returned string is
nul-terminated.  Furthermore, the removed check would harmlessly compare
an uninitialized byte with '\0' if the new name is shorter than
IFNAMESIZ - 1.

Reported by: KMSAN
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ad22ba2b9f3b6ff5d85be14627d3a59ca389f5e4)
sys/net/if.c