Bug 10211

Summary: mkpasswd.c:183: pointless test ?
Product: buildroot Reporter: David Binderman <dcb314>
Component: OtherAssignee: unassigned
Status: RESOLVED WONTFIX    
Severity: trivial CC: buildroot
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description David Binderman 2017-08-09 20:23:46 UTC
buildroot-2017.08-rc1/package/mkpasswd/mkpasswd.c:183]: (style) Checking if unsigned variable 'rounds' is less than zero.

Source code is

        rounds = strtol(optarg, &p, 10);
        if (p == NULL || *p != '\0' || rounds < 0) {

Maybe a call to strtoul would be better ?
Comment 1 Thomas Petazzoni 2018-01-10 22:08:20 UTC
This code comes from the whois project at https://github.com/rfc1036/whois/blob/next/mkpasswd.c. If there are any issues, please report them to the upstream project. We can then backport the fix, or upgrade to a newer version.