mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
Turn base < 0 into a BUG() in our long-parse functions.
This commit is contained in:
parent
decb927685
commit
accb734c5f
@ -1172,7 +1172,7 @@ tor_parse_long(const char *s, int base, long min, long max,
|
|||||||
char *endptr;
|
char *endptr;
|
||||||
long r;
|
long r;
|
||||||
|
|
||||||
if (base < 0) {
|
if (BUG(base < 0)) {
|
||||||
if (ok)
|
if (ok)
|
||||||
*ok = 0;
|
*ok = 0;
|
||||||
return 0;
|
return 0;
|
||||||
@ -1191,7 +1191,7 @@ tor_parse_ulong(const char *s, int base, unsigned long min,
|
|||||||
char *endptr;
|
char *endptr;
|
||||||
unsigned long r;
|
unsigned long r;
|
||||||
|
|
||||||
if (base < 0) {
|
if (BUG(base < 0)) {
|
||||||
if (ok)
|
if (ok)
|
||||||
*ok = 0;
|
*ok = 0;
|
||||||
return 0;
|
return 0;
|
||||||
@ -1223,7 +1223,7 @@ tor_parse_uint64(const char *s, int base, uint64_t min,
|
|||||||
char *endptr;
|
char *endptr;
|
||||||
uint64_t r;
|
uint64_t r;
|
||||||
|
|
||||||
if (base < 0) {
|
if (BUG(base < 0)) {
|
||||||
if (ok)
|
if (ok)
|
||||||
*ok = 0;
|
*ok = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user