mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
conversions.c: Specify that we only want to parse decimal numbers.
Passing 0 as the last argument to strtoimax() or strtoumax() causes octal and hexadecimal to be accepted which was not originally intended. So we now force to only accept decimal. ASTERISK-29950 #close Change-Id: I93baf0f273441e8280354630a463df263a8c0edd
This commit is contained in:
committed by
Friendly Automation
parent
2a87303ebd
commit
c33718a54d
@@ -99,7 +99,7 @@ int ast_str_to_imax(const char *str, intmax_t *res)
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
val = strtoimax(str, &end, 0);
|
||||
val = strtoimax(str, &end, 10);
|
||||
|
||||
/*
|
||||
* If str equals end then no digits were found. If end is not pointing to
|
||||
@@ -126,7 +126,7 @@ int ast_str_to_umax(const char *str, uintmax_t *res)
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
val = strtoumax(str, &end, 0);
|
||||
val = strtoumax(str, &end, 10);
|
||||
|
||||
/*
|
||||
* If str equals end then no digits were found. If end is not pointing to
|
||||
|
Reference in New Issue
Block a user