]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls_packet_get: avoid null pointer dereference on NULL input
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Tue, 12 Apr 2016 14:07:41 +0000 (16:07 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Tue, 12 Apr 2016 14:07:53 +0000 (16:07 +0200)
That is, still allow the function to handle a NULL packet
input but reset the data contents.

lib/record.c

index b07769f495203ec6d21e84ae088a12309f6b4f34..ca181622c1e7542febf1fd71e6484595079359b1 100644 (file)
@@ -1450,6 +1450,7 @@ void gnutls_packet_get(gnutls_packet_t packet, gnutls_datum_t *data, unsigned ch
                if (data) {
                        data->data = NULL;
                        data->size = 0;
+                       return;
                }
        }