https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229720
Bug ID: 229720
Summary: src/lib/libugidfw/ugidfw.c:105: poor error checking ?
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: misc
Assignee: [email protected]
Reporter: [email protected]
src/lib/libugidfw/ugidfw.c:105]: (style) Checking if unsigned variable 'len' is
less than zero.
Source code is
len = snprintf(cur, left, "uid %s",
pwd->pw_name);
if (len < 0 || len > left)
but len is unsigned and the return value from snprintf is int.
Suggest sanity check return value before assignment into unsigned variable.
Multiple duplicates:
src/lib/libugidfw/ugidfw.c:112]: (style) Checking if unsigned variable 'len' is
less than zero.
[src/lib/libugidfw/ugidfw.c:123]: (style) Checking if unsigned variable 'len'
is less than zero.
[src/lib/libugidfw/ugidfw.c:130]: (style) Checking if unsigned variable 'len'
is less than zero.
[src/lib/libugidfw/ugidfw.c:137]: (style) Checking if unsigned variable 'len'
is less than zero.
[src/lib/libugidfw/ugidfw.c:145]: (style) Checking if unsigned variable 'len'
is less than zero.
[src/lib/libugidfw/ugidfw.c:155]: (style) Checking if unsigned variable 'len'
is less than zero.
[src/lib/libugidfw/ugidfw.c:162]: (style) Checking if unsigned variable 'len'
is less than zero.
[src/lib/libugidfw/ugidfw.c:173]: (style) Checking if unsigned variable 'len'
is less than zero.
[src/lib/libugidfw/ugidfw.c:180]: (style) Checking if unsigned variable 'len'
is less than zero.
...
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"