提交 53a41cde 编写于 作者: P pchelko

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
上级 c68d1189
...@@ -1366,12 +1366,18 @@ Java_sun_awt_X11GraphicsConfig_pGetBounds(JNIEnv *env, jobject this, jint screen ...@@ -1366,12 +1366,18 @@ Java_sun_awt_X11GraphicsConfig_pGetBounds(JNIEnv *env, jobject this, jint screen
mid = (*env)->GetMethodID(env, clazz, "<init>", "(IIII)V"); mid = (*env)->GetMethodID(env, clazz, "<init>", "(IIII)V");
if (mid != NULL) { if (mid != NULL) {
if (usingXinerama) { if (usingXinerama) {
bounds = (*env)->NewObject(env, clazz, mid, fbrects[screen].x, if (0 <= screen && screen < awt_numScreens) {
fbrects[screen].y, bounds = (*env)->NewObject(env, clazz, mid, fbrects[screen].x,
fbrects[screen].width, fbrects[screen].y,
fbrects[screen].height); fbrects[screen].width,
} fbrects[screen].height);
else { } else {
jclass exceptionClass = (*env)->FindClass(env, "java/lang/IllegalArgumentException");
if (exceptionClass != NULL) {
(*env)->ThrowNew(env, exceptionClass, "Illegal screen index");
}
}
} else {
XWindowAttributes xwa; XWindowAttributes xwa;
memset(&xwa, 0, sizeof(xwa)); memset(&xwa, 0, sizeof(xwa));
......
...@@ -447,7 +447,7 @@ setXICWindowFocus(XIC ic, Window w) ...@@ -447,7 +447,7 @@ setXICWindowFocus(XIC ic, Window w)
*/ */
#define INITIAL_LOOKUP_BUF_SIZE 512 #define INITIAL_LOOKUP_BUF_SIZE 512
Bool Boolean
awt_x11inputmethod_lookupString(XKeyPressedEvent *event, KeySym *keysymp) awt_x11inputmethod_lookupString(XKeyPressedEvent *event, KeySym *keysymp)
{ {
JNIEnv *env = GetJNIEnv(); JNIEnv *env = GetJNIEnv();
...@@ -457,8 +457,8 @@ awt_x11inputmethod_lookupString(XKeyPressedEvent *event, KeySym *keysymp) ...@@ -457,8 +457,8 @@ awt_x11inputmethod_lookupString(XKeyPressedEvent *event, KeySym *keysymp)
int mblen; int mblen;
jstring javastr; jstring javastr;
XIC ic; XIC ic;
Bool result = True; Boolean result = True;
static Bool composing = False; static Boolean composing = False;
/* /*
printf("lookupString: entering...\n"); printf("lookupString: entering...\n");
......
...@@ -685,8 +685,7 @@ performPoll(JNIEnv *env, jlong nextTaskTime) { ...@@ -685,8 +685,7 @@ performPoll(JNIEnv *env, jlong nextTaskTime) {
if (result == 0) { if (result == 0) {
/* poll() timed out -- update timeout value */ /* poll() timed out -- update timeout value */
update_poll_timeout(TIMEOUT_TIMEDOUT); update_poll_timeout(TIMEOUT_TIMEDOUT);
PRINT2("%s(): TIMEOUT_TIMEDOUT curPollTimeout = %d \n", PRINT2("performPoll(): TIMEOUT_TIMEDOUT curPollTimeout = %d \n", curPollTimeout);
performPoll, curPollTimeout);
} }
if (pollFds[1].revents) { if (pollFds[1].revents) {
int count; int count;
...@@ -695,14 +694,12 @@ performPoll(JNIEnv *env, jlong nextTaskTime) { ...@@ -695,14 +694,12 @@ performPoll(JNIEnv *env, jlong nextTaskTime) {
do { do {
count = read(AWT_READPIPE, read_buf, AWT_POLL_BUFSIZE ); count = read(AWT_READPIPE, read_buf, AWT_POLL_BUFSIZE );
} while (count == AWT_POLL_BUFSIZE ); } while (count == AWT_POLL_BUFSIZE );
PRINT2("%s(): data on the AWT pipe: curPollTimeout = %d \n", PRINT2("performPoll(): data on the AWT pipe: curPollTimeout = %d \n", curPollTimeout);
performPoll, curPollTimeout);
} }
if (pollFds[0].revents) { if (pollFds[0].revents) {
// Events in X pipe // Events in X pipe
update_poll_timeout(TIMEOUT_EVENTS); update_poll_timeout(TIMEOUT_EVENTS);
PRINT2("%s(): TIMEOUT_EVENTS curPollTimeout = %ld \n", PRINT2("performPoll(): TIMEOUT_EVENTS curPollTimeout = %ld \n", curPollTimeout);
performPoll, curPollTimeout);
} }
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册