From 40eebf828b9d95453164e8f270068b946d570ee2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 25 Jun 2017 01:40:51 +0200 Subject: [PATCH] bitch more if NULL rows cause PQ result extraction to fail --- src/pq/pq_result_helper.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c index c5c8e56b9..d212ab1b8 100644 --- a/src/pq/pq_result_helper.c +++ b/src/pq/pq_result_helper.c @@ -83,8 +83,10 @@ extract_varsize_blob (void *cls, if (PQgetisnull (result, row, fnum)) + { + GNUNET_break (0); return GNUNET_SYSERR; - + } /* if a field is null, continue but * remember that we now return a different result */ len = PQgetlength (result, @@ -160,7 +162,10 @@ extract_fixed_blob (void *cls, if (PQgetisnull (result, row, fnum)) + { + GNUNET_break (0); return GNUNET_SYSERR; + } /* if a field is null, continue but * remember that we now return a different result */ @@ -241,8 +246,10 @@ extract_rsa_public_key (void *cls, if (PQgetisnull (result, row, fnum)) + { + GNUNET_break (0); return GNUNET_SYSERR; - + } /* if a field is null, continue but * remember that we now return a different result */ len = PQgetlength (result, @@ -340,8 +347,10 @@ extract_rsa_signature (void *cls, if (PQgetisnull (result, row, fnum)) + { + GNUNET_break (0); return GNUNET_SYSERR; - + } /* if a field is null, continue but * remember that we now return a different result */ len = PQgetlength (result, @@ -439,8 +448,10 @@ extract_string (void *cls, if (PQgetisnull (result, row, fnum)) + { + GNUNET_break (0); return GNUNET_SYSERR; - + } /* if a field is null, continue but * remember that we now return a different result */ len = PQgetlength (result, @@ -569,7 +580,10 @@ extract_uint16 (void *cls, if (PQgetisnull (result, row, fnum)) + { + GNUNET_break (0); return GNUNET_SYSERR; + } GNUNET_assert (NULL != dst); if (sizeof (uint16_t) != *dst_size) { @@ -639,7 +653,10 @@ extract_uint32 (void *cls, if (PQgetisnull (result, row, fnum)) + { + GNUNET_break (0); return GNUNET_SYSERR; + } GNUNET_assert (NULL != dst); if (sizeof (uint32_t) != *dst_size) { @@ -709,7 +726,10 @@ extract_uint64 (void *cls, if (PQgetisnull (result, row, fnum)) + { + GNUNET_break (0); return GNUNET_SYSERR; + } GNUNET_assert (NULL != dst); if (sizeof (uint64_t) != *dst_size) { -- 2.25.1