On Mon, 28 Sep 2026 08:10:32 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).
>
> Alexander Zvegintsev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   review comments

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

> 125:             if (!newScreens) {
> 126:                 ERR("failed to allocate memory\n");
> 127:                 return FALSE;

Please double check that this loop actually correctly de-/allocate the data via 
g_variant_iter_loop and g_variant_unref, as of now it sounds like double free? 
And this should be handled somehow on this return as well?

see: https://mail.gnome.org/archives/commits-list/2011-July/msg07600.html
and:
>"g_variant_iter_loop": on the first call to this function, the pointers 
>appearing on the variable argument list are assumed to point at uninitialised 
>memory. On the second and later calls, it is assumed that the same pointers 
>will be given and that they will point to the memory as set by the previous 
>call to this function. This allows the previous values to be freed, as 
>appropriate.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33059#discussion_r4127827099

Reply via email to