[Spice-devel] [PATCH spice-server 1/4] Clear "msg" pointers after releasing
Christophe Fergeau
cfergeau at redhat.com
Wed Feb 15 11:45:12 UTC 2017
On Wed, Feb 15, 2017 at 11:31:58AM +0000, Frediano Ziglio wrote:
> Avoid possible dangling pointers.
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> server/red-channel-client.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/server/red-channel-client.c b/server/red-channel-client.c
> index 9ab22e4..32db186 100644
> --- a/server/red-channel-client.c
> +++ b/server/red-channel-client.c
> @@ -1277,6 +1277,7 @@ static void red_channel_client_handle_incoming(RedChannelClient *rcc)
> if (bytes_read == -1) {
> red_channel_client_release_msg_buf(rcc, msg_type, msg_size,
> buffer->msg);
> + buffer->msg = NULL;
> red_channel_client_disconnect(rcc);
> return;
> }
> @@ -1296,6 +1297,7 @@ static void red_channel_client_handle_incoming(RedChannelClient *rcc)
> red_channel_client_release_msg_buf(rcc,
> msg_type, msg_size,
> buffer->msg);
> + buffer->msg = NULL;
> red_channel_client_disconnect(rcc);
> return;
> }
> --
> 2.9.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170215/5dcc43ac/attachment-0001.sig>
More information about the Spice-devel
mailing list