libfreerdp-core: add integer overflow check in GCC

This commit is contained in:
Marc-André Moreau 2012-01-15 15:20:39 -05:00
parent 277cbc3ccc
commit 8ed44b4f17

View File

@ -428,6 +428,9 @@ boolean gcc_read_user_data_header(STREAM* s, uint16* type, uint16* length)
stream_read_uint16(s, *type); /* type */
stream_read_uint16(s, *length); /* length */
if (*length < 4)
return false;
if (stream_get_left(s) < *length - 4)
return false;