changeset 7344:e8000751a585

8005661: [parfait] Possible buffer overrun in jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c 8005695: [parfait] Format string argument mismatch in jdk/src/solaris/native/sun/xawt/XToolkit.c 8005752: [parfait] False positive function call mismatch at jdk/src/solaris/native/sun/xawt/XWindow.c Reviewed-by: art, serb
author pchelko
date Wed, 19 Jun 2013 17:12:23 +0400
parents 6a3a2cb3ca6a
children a117785457f6 1c607ebfc180
files src/solaris/native/sun/awt/awt_GraphicsEnv.c src/solaris/native/sun/awt/awt_InputMethod.c src/solaris/native/sun/xawt/XToolkit.c
diffstat 3 files changed, 18 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Wed Jun 19 14:28:44 2013 +0400
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Wed Jun 19 17:12:23 2013 +0400
@@ -1366,12 +1366,18 @@
     mid = (*env)->GetMethodID(env, clazz, "<init>", "(IIII)V");
     if (mid != NULL) {
         if (usingXinerama) {
-            bounds = (*env)->NewObject(env, clazz, mid, fbrects[screen].x,
-                                                        fbrects[screen].y,
-                                                        fbrects[screen].width,
-                                                        fbrects[screen].height);
-        }
-        else {
+            if (0 <= screen && screen < awt_numScreens) {
+                bounds = (*env)->NewObject(env, clazz, mid, fbrects[screen].x,
+                                                            fbrects[screen].y,
+                                                            fbrects[screen].width,
+                                                            fbrects[screen].height);
+            } else {
+                jclass exceptionClass = (*env)->FindClass(env, "java/lang/IllegalArgumentException");
+                if (exceptionClass != NULL) {
+                    (*env)->ThrowNew(env, exceptionClass, "Illegal screen index");
+                }
+            }
+        } else {
             XWindowAttributes xwa;
             memset(&xwa, 0, sizeof(xwa));
 
--- a/src/solaris/native/sun/awt/awt_InputMethod.c	Wed Jun 19 14:28:44 2013 +0400
+++ b/src/solaris/native/sun/awt/awt_InputMethod.c	Wed Jun 19 17:12:23 2013 +0400
@@ -447,7 +447,7 @@
  */
 #define INITIAL_LOOKUP_BUF_SIZE 512
 
-Bool
+Boolean
 awt_x11inputmethod_lookupString(XKeyPressedEvent *event, KeySym *keysymp)
 {
     JNIEnv *env = GetJNIEnv();
@@ -457,8 +457,8 @@
     int mblen;
     jstring javastr;
     XIC ic;
-    Bool result = True;
-    static Bool composing = False;
+    Boolean result = True;
+    static Boolean composing = False;
 
     /*
       printf("lookupString: entering...\n");
--- a/src/solaris/native/sun/xawt/XToolkit.c	Wed Jun 19 14:28:44 2013 +0400
+++ b/src/solaris/native/sun/xawt/XToolkit.c	Wed Jun 19 17:12:23 2013 +0400
@@ -685,8 +685,7 @@
     if (result == 0) {
         /* poll() timed out -- update timeout value */
         update_poll_timeout(TIMEOUT_TIMEDOUT);
-        PRINT2("%s(): TIMEOUT_TIMEDOUT curPollTimeout = %d \n",
-              performPoll, curPollTimeout);
+        PRINT2("performPoll(): TIMEOUT_TIMEDOUT curPollTimeout = %d \n", curPollTimeout);
     }
     if (pollFds[1].revents) {
         int count;
@@ -695,14 +694,12 @@
         do {
             count = read(AWT_READPIPE, read_buf, AWT_POLL_BUFSIZE );
         } while (count == AWT_POLL_BUFSIZE );
-        PRINT2("%s():  data on the AWT pipe: curPollTimeout = %d \n",
-               performPoll, curPollTimeout);
+        PRINT2("performPoll():  data on the AWT pipe: curPollTimeout = %d \n", curPollTimeout);
     }
     if (pollFds[0].revents) {
         // Events in X pipe
         update_poll_timeout(TIMEOUT_EVENTS);
-        PRINT2("%s(): TIMEOUT_EVENTS curPollTimeout = %ld \n",
-               performPoll, curPollTimeout);
+        PRINT2("performPoll(): TIMEOUT_EVENTS curPollTimeout = %ld \n", curPollTimeout);
     }
     return;