On Thu, 22 Oct 2026 12:32:03 GMT, Matthias Baesken <[email protected]> wrote:

> The gcc static analyzer reports this issue :
> 
> `src/java.desktop/unix/native/common/java2d/x11/X11Renderer.c:86:17: warning: 
> use of possibly-NULL 'malloc((long unsigned int)newMax * 4)' where non-null 
> expected [CWE-690] [-Wanalyzer-possible-null-argument]`
> 
> Seems we miss NULL checks in the XDHD_ADD_POINT macro (for malloc).
> 
> While at it, should I NULL check realloc too?
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: e3dc4f97
Author:    Matthias Baesken <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/e3dc4f970687f6d62c75e50937f53a2d646c9f2e
Stats:     36 lines in 3 files changed: 19 ins; 0 del; 17 mod

8392568: [GCC static analyzer] potential NULL dereference in XDHD_ADD_POINT and 
FD_ADD_POINT macros

Reviewed-by: avu, prr

-------------

PR: https://git.openjdk.org/jdk/pull/33513

Reply via email to