Page MenuHomeFreeBSD

timeout(1): fix the acceptable range values for parse_signal()
ClosedPublic

Authored by alex_kaworu.ch on Oct 23 2015, 2:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 5, 3:45 AM
Unknown Object (File)
Mar 3 2025, 7:14 AM
Unknown Object (File)
Mar 3 2025, 6:17 AM
Unknown Object (File)
Mar 3 2025, 4:41 AM
Unknown Object (File)
Mar 3 2025, 12:08 AM
Unknown Object (File)
Feb 2 2025, 10:13 AM
Unknown Object (File)
Jan 23 2025, 12:58 PM
Unknown Object (File)
Jan 11 2025, 2:21 AM
Subscribers

Details

Summary

Before this patch, both 0 and sys_nsig would be successfully returned by parse_signal() although being invalid signal numbers.

Test Plan

none

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

alex_kaworu.ch retitled this revision from to timeout(1): fix the acceptable range values for parse_signal().
alex_kaworu.ch updated this object.
alex_kaworu.ch edited the test plan for this revision. (Show Details)
alex_kaworu.ch added a reviewer: bapt.

strtonum(3) says that minval and maxval are inclusive:

      int iterations;
      const char *errstr;

      iterations = strtonum(optarg, 1, 64, &errstr);
      if (errstr != NULL)
              errx(1, "number of iterations is %s: %s", errstr, optarg);

The above example will guarantee that the value of iterations is between
1 and 64 (inclusive).
bapt edited edge metadata.
This revision is now accepted and ready to land.Oct 24 2015, 1:45 PM
This revision was automatically updated to reflect the committed changes.