]> git.ipfire.org Git - thirdparty/tor.git/commit
Handle out-of-range values in tor_parse_* integer functions
authorNick Mathewson <nickm@torproject.org>
Mon, 7 May 2012 16:25:59 +0000 (12:25 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 7 May 2012 16:25:59 +0000 (12:25 -0400)
commit9b344628ed8f15543dc7780cc2a5cdd1b8f656cf
tree6356e826688bbdec9002070da2bdf236ccee39ad
parentf6afd4efa6c24fab8ace710fc0eac4c8811b93dd
Handle out-of-range values in tor_parse_* integer functions

The underlying strtoX functions handle overflow by saturating and
setting errno to ERANGE.  If the min/max arguments to the
tor_parse_* functions are equal to the minimum/maximum of the
underlying type, then with the old approach, we wouldn't treat a
too-large value as genuinely broken.

Found this while looking at bug 5786; bugfix on 19da1f36 (in Tor
0.0.9), which introduced these functions.
changes/bug5786_range [new file with mode: 0644]
src/common/util.c
src/test/test_util.c