commit fdcd67f0b3e0ca99d8d65ad85b2587faefe32580
parent 76ad063852d8afa8addcfef07f94e8295c2bd9d7
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Sun, 16 Aug 2026 08:35:08 +0200
init info->num to 0 on error paths, if non-NULL
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c
@@ -1176,6 +1176,8 @@ extract_array_generic (
if (PQgetisnull (result, row, col_num))
{
+ if (NULL != info->num)
+ *info->num = 0;
return GNUNET_NO;
}
@@ -1184,7 +1186,11 @@ extract_array_generic (
/* Report if this field is empty */
if (0 == (size_t) data_sz)
+ {
+ if (NULL != info->num)
+ *info->num = 0;
return GNUNET_NO;
+ }
data = PQgetvalue (result, row, col_num);
@@ -1199,7 +1205,8 @@ extract_array_generic (
data,
sizeof (ndim));
FAIL_IF (0 != ndim);
- *info->num = 0;
+ if (NULL != info->num)
+ *info->num = 0;
return GNUNET_OK;
}
FAIL_IF (sizeof(header) > (size_t) data_sz);
@@ -1517,6 +1524,8 @@ FAIL:
TALER_blinded_denom_sig_free (&denom_sigs[i]);
}
GNUNET_free (*(void **) dst);
+ if (NULL != info->num)
+ *info->num = 0;
return GNUNET_SYSERR;
#undef FAIL_IF
}