summaryrefslogtreecommitdiff
path: root/src/pq/pq_result_helper.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-06-25 01:40:51 +0200
committerChristian Grothoff <christian@grothoff.org>2017-06-25 01:40:51 +0200
commit40eebf828b9d95453164e8f270068b946d570ee2 (patch)
tree74c9d89c96b1e85dd015cf812415a14a687c607c /src/pq/pq_result_helper.c
parente15ee8365a5eb40aaf2448c4f649af30297d6817 (diff)
downloadgnunet-40eebf828b9d95453164e8f270068b946d570ee2.tar.gz
gnunet-40eebf828b9d95453164e8f270068b946d570ee2.zip
bitch more if NULL rows cause PQ result extraction to fail
Diffstat (limited to 'src/pq/pq_result_helper.c')
-rw-r--r--src/pq/pq_result_helper.c28
1 files 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,
83 if (PQgetisnull (result, 83 if (PQgetisnull (result,
84 row, 84 row,
85 fnum)) 85 fnum))
86 {
87 GNUNET_break (0);
86 return GNUNET_SYSERR; 88 return GNUNET_SYSERR;
87 89 }
88 /* if a field is null, continue but 90 /* if a field is null, continue but
89 * remember that we now return a different result */ 91 * remember that we now return a different result */
90 len = PQgetlength (result, 92 len = PQgetlength (result,
@@ -160,7 +162,10 @@ extract_fixed_blob (void *cls,
160 if (PQgetisnull (result, 162 if (PQgetisnull (result,
161 row, 163 row,
162 fnum)) 164 fnum))
165 {
166 GNUNET_break (0);
163 return GNUNET_SYSERR; 167 return GNUNET_SYSERR;
168 }
164 169
165 /* if a field is null, continue but 170 /* if a field is null, continue but
166 * remember that we now return a different result */ 171 * remember that we now return a different result */
@@ -241,8 +246,10 @@ extract_rsa_public_key (void *cls,
241 if (PQgetisnull (result, 246 if (PQgetisnull (result,
242 row, 247 row,
243 fnum)) 248 fnum))
249 {
250 GNUNET_break (0);
244 return GNUNET_SYSERR; 251 return GNUNET_SYSERR;
245 252 }
246 /* if a field is null, continue but 253 /* if a field is null, continue but
247 * remember that we now return a different result */ 254 * remember that we now return a different result */
248 len = PQgetlength (result, 255 len = PQgetlength (result,
@@ -340,8 +347,10 @@ extract_rsa_signature (void *cls,
340 if (PQgetisnull (result, 347 if (PQgetisnull (result,
341 row, 348 row,
342 fnum)) 349 fnum))
350 {
351 GNUNET_break (0);
343 return GNUNET_SYSERR; 352 return GNUNET_SYSERR;
344 353 }
345 /* if a field is null, continue but 354 /* if a field is null, continue but
346 * remember that we now return a different result */ 355 * remember that we now return a different result */
347 len = PQgetlength (result, 356 len = PQgetlength (result,
@@ -439,8 +448,10 @@ extract_string (void *cls,
439 if (PQgetisnull (result, 448 if (PQgetisnull (result,
440 row, 449 row,
441 fnum)) 450 fnum))
451 {
452 GNUNET_break (0);
442 return GNUNET_SYSERR; 453 return GNUNET_SYSERR;
443 454 }
444 /* if a field is null, continue but 455 /* if a field is null, continue but
445 * remember that we now return a different result */ 456 * remember that we now return a different result */
446 len = PQgetlength (result, 457 len = PQgetlength (result,
@@ -569,7 +580,10 @@ extract_uint16 (void *cls,
569 if (PQgetisnull (result, 580 if (PQgetisnull (result,
570 row, 581 row,
571 fnum)) 582 fnum))
583 {
584 GNUNET_break (0);
572 return GNUNET_SYSERR; 585 return GNUNET_SYSERR;
586 }
573 GNUNET_assert (NULL != dst); 587 GNUNET_assert (NULL != dst);
574 if (sizeof (uint16_t) != *dst_size) 588 if (sizeof (uint16_t) != *dst_size)
575 { 589 {
@@ -639,7 +653,10 @@ extract_uint32 (void *cls,
639 if (PQgetisnull (result, 653 if (PQgetisnull (result,
640 row, 654 row,
641 fnum)) 655 fnum))
656 {
657 GNUNET_break (0);
642 return GNUNET_SYSERR; 658 return GNUNET_SYSERR;
659 }
643 GNUNET_assert (NULL != dst); 660 GNUNET_assert (NULL != dst);
644 if (sizeof (uint32_t) != *dst_size) 661 if (sizeof (uint32_t) != *dst_size)
645 { 662 {
@@ -709,7 +726,10 @@ extract_uint64 (void *cls,
709 if (PQgetisnull (result, 726 if (PQgetisnull (result,
710 row, 727 row,
711 fnum)) 728 fnum))
729 {
730 GNUNET_break (0);
712 return GNUNET_SYSERR; 731 return GNUNET_SYSERR;
732 }
713 GNUNET_assert (NULL != dst); 733 GNUNET_assert (NULL != dst);
714 if (sizeof (uint64_t) != *dst_size) 734 if (sizeof (uint64_t) != *dst_size)
715 { 735 {