Fix oob read in msusb_msconfig_read

This commit is contained in:
akallabeth 2020-04-15 17:27:40 +02:00
parent 6b485b146a
commit 5305d62b72

View File

@ -317,7 +317,7 @@ MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(wStream* s, UINT32 NumInterfaces)
MSUSB_CONFIG_DESCRIPTOR* MsConfig; MSUSB_CONFIG_DESCRIPTOR* MsConfig;
BYTE lenConfiguration, typeConfiguration; BYTE lenConfiguration, typeConfiguration;
if (Stream_GetRemainingCapacity(s) < 6 + NumInterfaces * 2) if (Stream_GetRemainingCapacity(s) < 6ULL + NumInterfaces * 2ULL)
return NULL; return NULL;
MsConfig = msusb_msconfig_new(); MsConfig = msusb_msconfig_new();