From: Schanzenbach, Martin Date: Tue, 3 Mar 2020 12:32:31 +0000 (+0100) Subject: fix NULL ptr deref in attestations X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c0236414b243d7bf8a60e9906f44fe527df49631;p=oweals%2Fgnunet.git fix NULL ptr deref in attestations --- diff --git a/src/reclaim/reclaim_attestation.c b/src/reclaim/reclaim_attestation.c index 66da8e74a..bdf80a709 100644 --- a/src/reclaim/reclaim_attestation.c +++ b/src/reclaim/reclaim_attestation.c @@ -336,6 +336,13 @@ GNUNET_RECLAIM_attestation_list_deserialize (const char *data, size_t data_size) ale->attestation = GNUNET_RECLAIM_attestation_deserialize (read_ptr, data_size - (read_ptr - data)); + if (NULL == ale->attestation) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Failed to deserialize malformed attestation.\n"); + GNUNET_free (ale); + return al; + } GNUNET_CONTAINER_DLL_insert (al->list_head, al->list_tail, ale); att_len = GNUNET_RECLAIM_attestation_serialize_get_size (ale->attestation); read_ptr += att_len;