8161742: [parfait] Uninitialised memory in isXTestAvailable of awt_Robot.c:65
authorvadim
Tue, 26 Jul 2016 14:54:26 +0300
changeset 40148 f590f972ba1a
parent 40147 92ca3df5b584
child 40149 3c1b3274aa52
8161742: [parfait] Uninitialised memory in isXTestAvailable of awt_Robot.c:65 Reviewed-by: serb, ssadetsky
jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c
jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c	Tue Jul 26 14:19:40 2016 +0300
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c	Tue Jul 26 14:54:26 2016 +0300
@@ -100,9 +100,9 @@
 
     /* check if XTest is available */
     isXTestAvailable = XQueryExtension(awt_display, XTestExtensionName, &major_opcode, &first_event, &first_error);
-    DTRACE_PRINTLN3("RobotPeer: XQueryExtension(XTEST) returns major_opcode = %d, first_event = %d, first_error = %d",
-                    major_opcode, first_event, first_error);
     if (isXTestAvailable) {
+        DTRACE_PRINTLN3("RobotPeer: XQueryExtension(XTEST) returns major_opcode = %d, first_event = %d, first_error = %d",
+                        major_opcode, first_event, first_error);
         /* check if XTest version is OK */
         XTestQueryExtension(awt_display, &event_basep, &error_basep, &majorp, &minorp);
         DTRACE_PRINTLN4("RobotPeer: XTestQueryExtension returns event_basep = %d, error_basep = %d, majorp = %d, minorp = %d",
--- a/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c	Tue Jul 26 14:19:40 2016 +0300
+++ b/jdk/src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c	Tue Jul 26 14:54:26 2016 +0300
@@ -1021,9 +1021,9 @@
      * before calling XTestFakeButtonEvent().
      */
     xinputAvailable = XQueryExtension(awt_display, INAME, &major_opcode, &first_event, &first_error);
-    DTRACE_PRINTLN3("RobotPeer: XQueryExtension(XINPUT) returns major_opcode = %d, first_event = %d, first_error = %d",
-                    major_opcode, first_event, first_error);
     if (xinputAvailable) {
+        DTRACE_PRINTLN3("RobotPeer: XQueryExtension(XINPUT) returns major_opcode = %d, first_event = %d, first_error = %d",
+                        major_opcode, first_event, first_error);
         devices = XListInputDevices(awt_display, &numDevices);
         for (devIdx = 0; devIdx < numDevices; devIdx++) {
             aDevice = &(devices[devIdx]);