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
F166342937: D3990.id.diff
Thu, Aug 13, 12:44 AM
Unknown Object (File)
Tue, Aug 11, 8:54 AM
Unknown Object (File)
Mon, Aug 10, 12:11 PM
Unknown Object (File)
Sat, Aug 8, 5:40 AM
Unknown Object (File)
Jul 12 2026, 3:26 AM
Unknown Object (File)
Jun 21 2026, 7:43 PM
Unknown Object (File)
Jun 19 2026, 3:59 PM
Unknown Object (File)
Jun 19 2026, 1:41 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.