File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2201,6 +2201,10 @@ void AOTCodeCache::load_strings() {
22012201 if (strings_count == 0 ) {
22022202 return ;
22032203 }
2204+ if (strings_count > MAX_STR_COUNT) {
2205+ fatal (" Invalid strings_count loaded from AOT Code Cache: %d > MAX_STR_COUNT [%d]" , strings_count, MAX_STR_COUNT);
2206+ return ;
2207+ }
22042208 uint strings_offset = _load_header->strings_offset ();
22052209 uint* string_lengths = (uint*)addr (strings_offset);
22062210 strings_offset += (strings_count * sizeof (uint));
@@ -2211,7 +2215,6 @@ void AOTCodeCache::load_strings() {
22112215 char * p = NEW_C_HEAP_ARRAY (char , strings_size+1 , mtCode);
22122216 memcpy (p, addr (strings_offset), strings_size);
22132217 _C_strings_buf = p;
2214- assert (strings_count <= MAX_STR_COUNT, " sanity" );
22152218 for (uint i = 0 ; i < strings_count; i++) {
22162219 _C_strings[i] = p;
22172220 uint len = string_lengths[i];
You can’t perform that action at this time.
0 commit comments