donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 9bf9696a85af1b66348f88f6d932445e8ac7f7f6
parent f866768c4e51abedac15666f08720a3b42384855
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Mon, 20 Jul 2026 00:01:51 +0200

check for du_sigs being NULL before derefing

Diffstat:
Msrc/pq/pq_query_helper.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c @@ -801,9 +801,12 @@ array_cleanup (void *cls, GNUNET_free (*(info->sizes)); GNUNET_assert (NULL != info->num); - for (size_t i = 0; i < *info->num; i++) - if (NULL != du_sigs[i].blinded_sig) - GNUNET_CRYPTO_blinded_sig_decref (du_sigs[i].blinded_sig); + /* A failed extract_array_generic() sets *dst (du_sigs) to NULL but may + leave *info->num != 0; guard against dereferencing a NULL array. */ + if (NULL != du_sigs) + for (size_t i = 0; i < *info->num; i++) + if (NULL != du_sigs[i].blinded_sig) + GNUNET_CRYPTO_blinded_sig_decref (du_sigs[i].blinded_sig); GNUNET_free (info); GNUNET_free (du_sigs); *dst = NULL;