Merge pull request #1656 from hardening/CVE-2014-0791-v2

Fix CVE-2014-0791
This commit is contained in:
Marc-André Moreau 2014-01-08 08:01:38 -08:00
commit 3d75db05e9

View File

@ -669,6 +669,8 @@ BOOL license_read_scope_list(wStream* s, SCOPE_LIST* scopeList)
return FALSE;
Stream_Read_UINT32(s, scopeCount); /* ScopeCount (4 bytes) */
if (scopeCount > Stream_GetRemainingLength(s) / 4) /* every blob is at least 4 bytes */
return FALSE;
scopeList->count = scopeCount;
scopeList->array = (LICENSE_BLOB*) malloc(sizeof(LICENSE_BLOB) * scopeCount);