From: Nikos Mavrogiannopoulos Date: Tue, 12 Apr 2016 14:07:41 +0000 (+0200) Subject: gnutls_packet_get: avoid null pointer dereference on NULL input X-Git-Tag: gnutls_3_5_0~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3073720273bb45adc6d59f6dad0e43efa4e224fb;p=thirdparty%2Fgnutls.git gnutls_packet_get: avoid null pointer dereference on NULL input That is, still allow the function to handle a NULL packet input but reset the data contents. --- diff --git a/lib/record.c b/lib/record.c index b07769f495..ca181622c1 100644 --- a/lib/record.c +++ b/lib/record.c @@ -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; } }