While this is already enforced in practice due to the limits on the
maximum control interface command length and total_length bounds
checking here, this explicit check on payload_length value may help
static analyzers understand the code better. (CID 122668)
Signed-off-by: Jouni Malinen <j@w1.fi>
if (size < 6)
return -1;
record->payload_length = WPA_GET_BE32(pos);
- if (record->payload_length > size - 6)
+ if (record->payload_length > size - 6 ||
+ record->payload_length > 20000)
return -1;
pos += sizeof(u32);
}