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
F105880816: D3990.id9684.diff
Sun, Dec 22, 1:39 AM
Unknown Object (File)
Wed, Dec 4, 10:17 PM
Unknown Object (File)
Oct 28 2024, 9:47 PM
Unknown Object (File)
Oct 28 2024, 9:45 PM
Unknown Object (File)
Oct 28 2024, 9:45 PM
Unknown Object (File)
Oct 28 2024, 9:31 PM
Unknown Object (File)
Oct 4 2024, 11:51 PM
Unknown Object (File)
Sep 27 2024, 7:03 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.