JDK-4082522 : awt_MToolkit_loop switches on xev.type, which may contain garbage.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.5
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1997-09-29
  • Updated: 1998-08-13
  • Resolved: 1998-08-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other
1.1.5 1.1.5Fixed 1.2.0Fixed
Related Reports
Relates :  
Description
In awt_MToolkit.c, function awt_MToolkit_loop did *not* check whether
the call to XtAppPeekEvent returned True or False. A True return value
indicates that it found an X event on the queue, a False value that it
did not.  But if it returned False, this code went ahead and switched on
the event type in xev.type anyway, which may contain garbage on the stack.
In that case, the execution of this switch was unsafe and unpredictable.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.1.5 1.2 FIXED IN: 1.1.5 1.2 INTEGRATED IN: 1.1.5 1.2 VERIFIED IN: 1.1.5
14-06-2004

EVALUATION The Boolean return value of XtAppPeekEvent needs to be checked, to prevent switching on garbage.
11-06-2004

SUGGESTED FIX Check the return value of XtAppPeekEvent as follows: if (XtAppPeekEvent(awt_appContext, &xev)) { /* There is an X event on the queue. */ switch (xev.type) { ... } } else /* There must be a timer, alternate input, or signal event. */ XtAppProcessEvent(awt_appContext, iMask);
11-06-2004