diff options
author | José M. Guisado <guigom@riseup.net> | 2019-09-18 13:28:29 +0200 |
---|---|---|
committer | José M. Guisado <guigom@riseup.net> | 2019-10-28 11:38:41 +0100 |
commit | 42ba3997d64591822411fbbedd51a240dbbb5fab (patch) | |
tree | 3845879d4c2914f2ef22c9019ac90da31ebc8462 /src/lib/confmgt/.may_include | |
parent | f237529fff657bbbf8d2f2632337d9848446d7da (diff) | |
download | tor-42ba3997d64591822411fbbedd51a240dbbb5fab.tar.gz tor-42ba3997d64591822411fbbedd51a240dbbb5fab.zip |
Check memunit parsing for overflow in confparse
Before, when parsing memunits, if overflow occured it failed silently.
Use nowrap u64 math to detect overflow, compare to INT64_MAX and if
greater tell user and fail accordingly.
15000000.5 TB fails double check as it a greater floating number than
(double)INT64_MAX
8388608.1 TB passes double check because it falls in the same value as
(double)INT64_MAX (which is 2^63), but will fail the int check because
(uint64_t)d, which is 2^63, is strictly greater than 2^63-1 (INT64_MAX).
Fixes #30920
Signed-off-by: José M. Guisado <guigom@riseup.net>
Diffstat (limited to 'src/lib/confmgt/.may_include')
-rw-r--r-- | src/lib/confmgt/.may_include | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/confmgt/.may_include b/src/lib/confmgt/.may_include index 2564133917..5ff949f103 100644 --- a/src/lib/confmgt/.may_include +++ b/src/lib/confmgt/.may_include @@ -4,6 +4,7 @@ lib/conf/*.h lib/confmgt/*.h lib/container/*.h lib/encoding/*.h +lib/intmath/*.h lib/log/*.h lib/malloc/*.h lib/string/*.h |