commit 798c82098bad425ccf90a405c2952be6d88ed097
parent 8c34d91adf6884b1282d57760b3c22d55e807458
Author: Özgür Kesim <oec-taler@kesim.org>
Date: Sat, 1 Jul 2023 21:50:09 +0200
-coverity finding fixes
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c
@@ -21,9 +21,10 @@
* @file pq/pq_result_helper.c
* @brief functions to extract result values
* @author Christian Grothoff
+ * @author Özgür Kesim
*/
-#include "gnunet_time_lib.h"
#include "platform.h"
+#include "gnunet_time_lib.h"
#include "gnunet_common.h"
#include "gnunet_util_lib.h"
#include "gnunet_pq_lib.h"
@@ -1208,7 +1209,7 @@ extract_array_generic (
header.lbound = ntohl (h->lbound);
FAIL_IF (1 != header.ndim);
- FAIL_IF ((0 > header.dim) || (INT_MAX == header.dim));
+ FAIL_IF (INT_MAX <= header.dim);
FAIL_IF (0 != header.has_null);
FAIL_IF (1 != header.lbound);
FAIL_IF (info->oid != header.oid);
@@ -1372,8 +1373,8 @@ extract_array_generic (
if (NULL != dst_size)
*dst_size = total;
- if (0 < total)
- out = GNUNET_malloc (total);
+ FAIL_IF (0 == total);
+ out = GNUNET_malloc (total);
*((void **) dst) = out;
diff --git a/src/pq/test_pq.c b/src/pq/test_pq.c
@@ -22,10 +22,10 @@
* @brief Tests for Postgres convenience API
* @author Christian Grothoff <christian@grothoff.org>
*/
+#include "platform.h"
#include "gnunet_common.h"
#include "gnunet_pq_lib.h"
#include "gnunet_time_lib.h"
-#include "platform.h"
#include "pq.h"
/**