summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-12 16:07:41 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-12 16:07:53 +0200
commit3073720273bb45adc6d59f6dad0e43efa4e224fb (patch)
tree67a2cfadc55d4ea4d3a411b19025edbd30bde2b8
parent9eb5b59d45924950f32c73018c820ee7d858df20 (diff)
downloadgnutls-3073720273bb45adc6d59f6dad0e43efa4e224fb.tar.gz
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.
-rw-r--r--lib/record.c1
1 files changed, 1 insertions, 0 deletions
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;
}
}