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

JDK_GetVersionInfo0 fails to zero structure

    Details

    • Subcomponent:
    • Resolved In Build:
      b01
    • CPU:
      generic
    • OS:
      generic

      Description

      JDK's JDK_GetVersionInfo0 is not clearing the structure it fills in, which can leave bits describing new features set to true.

        Issue Links

          Activity

          Hide
          kevinw Kevin Walls added a comment -
          BT2:SUGGESTED FIX

          (5.10)$ hg diff src/share/native/common/jdk_util.c
          diff --git a/src/share/native/common/jdk_util.c b/src/share/native/common/jdk_util.c
          --- a/src/share/native/common/jdk_util.c
          +++ b/src/share/native/common/jdk_util.c
          @@ -76,7 +76,7 @@ JDK_GetVersionInfo0(jdk_version_info* in
               }


          - memset(info, 0, sizeof(info_size));
          + memset(info, 0, info_size);
               info->jdk_version = ((jdk_major_version & 0xFF) << 24) |
                                   ((jdk_minor_version & 0xFF) << 16) |
                                   ((jdk_micro_version & 0xFF) << 8) |
          Show
          kevinw Kevin Walls added a comment - BT2:SUGGESTED FIX (5.10)$ hg diff src/share/native/common/jdk_util.c diff --git a/src/share/native/common/jdk_util.c b/src/share/native/common/jdk_util.c --- a/src/share/native/common/jdk_util.c +++ b/src/share/native/common/jdk_util.c @@ -76,7 +76,7 @@ JDK_GetVersionInfo0(jdk_version_info* in      } - memset(info, 0, sizeof(info_size)); + memset(info, 0, info_size);      info->jdk_version = ((jdk_major_version & 0xFF) << 24) |                          ((jdk_minor_version & 0xFF) << 16) |                          ((jdk_micro_version & 0xFF) << 8) |
          Hide
          alanb Alan Bateman added a comment - - edited
          This one was spotted, and fixed, when addressing compiler warnings in 6989466. I'm adding the 7-na keyword here so that when it is fixed in jdk6, it doesn't appear on the list to be forward ported to 7.
          Show
          alanb Alan Bateman added a comment - - edited This one was spotted, and fixed, when addressing compiler warnings in 6989466. I'm adding the 7-na keyword here so that when it is fixed in jdk6, it doesn't appear on the list to be forward ported to 7.
          Hide
          kevinw Kevin Walls added a comment -
          BT2:EVALUATION

          As comments.
          Show
          kevinw Kevin Walls added a comment - BT2:EVALUATION As comments.

            People

            • Assignee:
              kevinw Kevin Walls
              Reporter:
              kevinw Kevin Walls
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: