File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -380,7 +380,6 @@ static void pe_parse_debug_directory(PE* pe)
380
380
// Return a pointer to the resource directory string or NULL.
381
381
// The callback function will parse this and call yr_set_sized_string().
382
382
// The pointer is guaranteed to have enough space to contain the entire string.
383
-
384
383
static const PIMAGE_RESOURCE_DIR_STRING_U parse_resource_name (
385
384
PE * pe ,
386
385
const uint8_t * rsrc_data ,
@@ -397,10 +396,13 @@ static const PIMAGE_RESOURCE_DIR_STRING_U parse_resource_name(
397
396
398
397
// A resource directory string is 2 bytes for the length and then a variable
399
398
// length Unicode string. Make sure we have at least 2 bytes.
400
-
401
399
if (!fits_in_pe (pe , pNameString , 2 ))
402
400
return NULL ;
403
401
402
+ // Sanity check for strings that are excesively large.
403
+ if (pNameString -> Length > 1000 )
404
+ return NULL ;
405
+
404
406
// Move past the length and make sure we have enough bytes for the string.
405
407
if (!fits_in_pe (
406
408
pe ,
You can’t perform that action at this time.
0 commit comments