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
F132692634: D3990.diff
Sun, Oct 19, 2:36 AM
Unknown Object (File)
Fri, Oct 17, 3:49 AM
Unknown Object (File)
Thu, Oct 16, 6:42 PM
Unknown Object (File)
Thu, Oct 16, 6:42 PM
Unknown Object (File)
Thu, Oct 16, 8:24 AM
Unknown Object (File)
Thu, Sep 25, 1:08 PM
Unknown Object (File)
Sun, Sep 21, 6:05 PM
Unknown Object (File)
Sep 10 2025, 8:14 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.