From bfaf0af48f9bd6a6fa636f87cc980267e373fcd2 Mon Sep 17 00:00:00 2001 From: vadim Date: Tue, 26 Jul 2016 14:54:26 +0300 Subject: [PATCH] 8161742: [parfait] Uninitialised memory in isXTestAvailable of awt_Robot.c:65 Reviewed-by: serb, ssadetsky --- src/solaris/native/sun/awt/awt_Robot.c | 4 ++-- src/solaris/native/sun/xawt/XToolkit.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/solaris/native/sun/awt/awt_Robot.c b/src/solaris/native/sun/awt/awt_Robot.c index 89f282c3d..b8f1b759b 100644 --- a/src/solaris/native/sun/awt/awt_Robot.c +++ b/src/solaris/native/sun/awt/awt_Robot.c @@ -61,9 +61,9 @@ static int32_t isXTestAvailable() { /* 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", diff --git a/src/solaris/native/sun/xawt/XToolkit.c b/src/solaris/native/sun/xawt/XToolkit.c index 099c1677e..71d41f377 100644 --- a/src/solaris/native/sun/xawt/XToolkit.c +++ b/src/solaris/native/sun/xawt/XToolkit.c @@ -1020,9 +1020,9 @@ int32_t getNumButtons() { * 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]); -- GitLab