On Thu, 24 Sep 2026 19:55:12 GMT, Alexander Zvegintsev <[email protected]> 
wrote:

> Fixed three potential null pointer dereferences:
> * Two in log messages.
> * One during cleanup after a failed realloc, which also leaked the original 
> allocation.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.c line 319:

> 317:     if (!spaBuffer
> 318:         || spaBuffer->n_datas < 1
> 319:         || spaBuffer->datas[0].data == NULL) {

Should this code check the "chunk" for NULL as well?

src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.c line 321:

> 319:         || spaBuffer->datas[0].data == NULL) {
> 320:         DEBUG_SCREEN_PREFIX(screen, "!!! no data, n_datas %d\n",
> 321:                             spaBuffer ? (int) spaBuffer->n_datas : -1);

seems fp_pw_stream_queue_buffer(data->stream, pwBuffer); is missing on this 
return?

src/java.desktop/unix/native/libawt_xawt/awt/screencast_portal.c line 121:

> 119:             struct ScreenProps *newScreens = realloc(
> 120:                     screenSpace.screens,
> 121:                     ++screenSpace.allocated * sizeof(struct ScreenProps)

++screenSpace.allocated should be bumped on success only?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33059#discussion_r4113770765
PR Review Comment: https://git.openjdk.org/jdk/pull/33059#discussion_r4113770221
PR Review Comment: https://git.openjdk.org/jdk/pull/33059#discussion_r4113772418

Reply via email to