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

Details
Type:
Bug
Submit Date:
2010-10-06
Status:
Resolved
Updated Date:
2011-01-25
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

Related Reports

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
EVALUATION

As comments.
                                     
2010-10-08
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



Hardware and Software, Engineered to Work Together