Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8187570

Comparison between pointer and char in MethodMatcher::canonicalize

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 10
    • 10
    • hotspot
    • None
    • b31

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              ehelin Erik Helin
              ehelin Erik Helin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: