There is a comparison between a pointer and a char in MethodMatcher::canonicalize:
bool MethodMatcher::canonicalize(char * line, const char *& error_msg) {
char* colon = strstr(line, "::");
bool have_colon = (colon != NULL);
if (have_colon) {
// Don't allow multiple '::'
if (colon + 2 != '\0') {
if (strstr(colon+2, "::")) {
error_msg = "Method pattern only allows one '::' allowed";
return false;
}
}
The proper if check would `if (colon[2] != '\0')`. This was also reported by Yasumasa Suenaga.
bool MethodMatcher::canonicalize(char * line, const char *& error_msg) {
char* colon = strstr(line, "::");
bool have_colon = (colon != NULL);
if (have_colon) {
// Don't allow multiple '::'
if (colon + 2 != '\0') {
if (strstr(colon+2, "::")) {
error_msg = "Method pattern only allows one '::' allowed";
return false;
}
}
The proper if check would `if (colon[2] != '\0')`. This was also reported by Yasumasa Suenaga.
- relates to
-
JDK-8181503 Can't compile hotspot with c++11
-
- Resolved
-