What is returned from JImageGetResource() is not a C "string" (as it is not null terminated). It uses the '\n' delimiter to sentinel individual module entry names.
Treating this data as a C string (using for example strlen() and strchr()) is risky:
int buflen = (int)strlen(char_buf);
The use of strlen() here reads outside of the data returned from JImageGetResource() - in my case it even read into an unmapped page, causing a SIGSEGV.
Treating this data as a C string (using for example strlen() and strchr()) is risky:
int buflen = (int)strlen(char_buf);
The use of strlen() here reads outside of the data returned from JImageGetResource() - in my case it even read into an unmapped page, causing a SIGSEGV.
- duplicates
-
JDK-8155574 ClassLoader::initialize_module_loader_map crashes if the char_buf is not NULL terminated
-
- Resolved
-