United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6989972 JDK_GetVersionInfo0 fails to zero structure
JDK-6989972 : JDK_GetVersionInfo0 fails to zero structure

Details
Type:
Bug
Submit Date:
2010-10-06
Status:
Resolved
Updated Date:
2014-02-26
Project Name:
JDK
Resolved Date:
2011-01-25
Component:
core-libs
OS:
generic
Sub-Component:
java.lang
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
6u25 (b01)

Related Reports
Relates:

Sub Tasks

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

                                    

Comments
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)  |
                                     
2010-10-06
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.
                                     
2010-10-07
EVALUATION

As comments.
                                     
2010-10-08



Hardware and Software, Engineered to Work Together