From 8ed44b4f1739c340ece3cc4d8f9c776a703d581c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Sun, 15 Jan 2012 15:20:39 -0500 Subject: [PATCH] libfreerdp-core: add integer overflow check in GCC --- libfreerdp-core/gcc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libfreerdp-core/gcc.c b/libfreerdp-core/gcc.c index 565fdea8c..1b1254920 100644 --- a/libfreerdp-core/gcc.c +++ b/libfreerdp-core/gcc.c @@ -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;