You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@guacamole.apache.org by "Nick Couchman (Jira)" <ji...@apache.org> on 2023/02/17 21:03:00 UTC

[jira] [Closed] (GUACAMOLE-1517) data->written is not initialized in guac_socket_nest()

     [ https://issues.apache.org/jira/browse/GUACAMOLE-1517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Couchman closed GUACAMOLE-1517.
------------------------------------
    Resolution: Won't Fix

Closing as "Won't Fix" due to the reasons Mike mentioned - code is deprecated and will be removed.

> data->written is not initialized in guac_socket_nest()
> ------------------------------------------------------
>
>                 Key: GUACAMOLE-1517
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-1517
>             Project: Guacamole
>          Issue Type: Bug
>          Components: libguac
>            Reporter: Andreas Vögele
>            Priority: Trivial
>
> data->written needs to be set to 0 in guac_socket_nest() in src/libguac/socket-nest.c. Alternatively the "data" structure could be allocated with calloc() instead of malloc().
> The tests may fail and produce a core dump if data->written is not initialized.
> {code:java}
>     /* Store nested socket details as socket data */
>     data->parent = parent;
>     data->index = index;
>     data->written = 0; // <----
>     socket->data = data;{code}
> There's also the following code in src/libguac/tests/socket/nested_send_instruction.c:
> {code:java}
>     guac_socket* nested_socket = guac_socket_nest(socket, 123);
>     /* Write nothing if nested socket cannot be allocated (test will fail in
>      * parent process due to failure to read) */
>     if (socket == NULL) {
>         guac_socket_free(socket);
>         return;
>     }
> {code}
> Shouldn't the if-condition check nested_socket?
> {code:java}
> if (nested_socket == NULL){code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)