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, Jan 11, 2:21 AM
Unknown Object (File)
Tue, Jan 7, 9:03 PM
Unknown Object (File)
Tue, Jan 7, 4:49 PM
Unknown Object (File)
Thu, Jan 2, 9:14 PM
Unknown Object (File)
Tue, Dec 31, 1:50 PM
Unknown Object (File)
Dec 22 2024, 1:39 AM
Unknown Object (File)
Dec 4 2024, 10:17 PM
Unknown Object (File)
Oct 28 2024, 9:47 PM
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.