Description
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.
/* Store nested socket details as socket data */ data->parent = parent; data->index = index; data->written = 0; // <---- socket->data = data;
There's also the following code in src/libguac/tests/socket/nested_send_instruction.c:
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; }
Shouldn't the if-condition check nested_socket?
if (nested_socket == NULL)
Attachments
Issue Links
- is related to
-
GUACAMOLE-510 Nested socket index is not initialized
- Resolved