JDK-8231445 : check ZALLOC return values in awt coding
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 11,13,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2019-09-25
  • Updated: 2020-10-04
  • Resolved: 2019-09-26
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.
JDK 11 JDK 13 JDK 14
11.0.10-oracleFixed 13.0.4Fixed 14 b17Fixed
Description
ZALLOC is a macro  using calloc, see :

jdk/src/java.desktop/unix/native/common/awt/awt_p.h
/* allocated and initialize a structure */
#define ZALLOC(T)       ((struct T *)calloc(1, sizeof(struct T)))

so the return value has to be checked which is missing at some places.
Comments
Fix request (13u): may be fixed; should be fixed; patch applies cleanly.
26-05-2020

jdk11 fix request I would like to have the fix in jdk11 as well, because the issue is present there too. The patch applies cleanly.
19-12-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/3a5f417e68a1 User: mbaesken Date: 2019-09-26 07:24:36 +0000
26-09-2019