Limit freq_range_list_parse() result to UINT_MAX entries
This addresses a theoretical integer overflow with configuration parameters with 16-bit int. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
2f06008564
commit
749add5c64
1 changed files with 4 additions and 0 deletions
|
@ -791,6 +791,10 @@ int freq_range_list_parse(struct wpa_freq_range_list *res, const char *value)
|
||||||
*/
|
*/
|
||||||
pos = value;
|
pos = value;
|
||||||
while (pos && pos[0]) {
|
while (pos && pos[0]) {
|
||||||
|
if (count == UINT_MAX) {
|
||||||
|
os_free(freq);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
n = os_realloc_array(freq, count + 1,
|
n = os_realloc_array(freq, count + 1,
|
||||||
sizeof(struct wpa_freq_range));
|
sizeof(struct wpa_freq_range));
|
||||||
if (n == NULL) {
|
if (n == NULL) {
|
||||||
|
|
Loading…
Reference in a new issue