From 3834d81b461c3066caee6fa97b77561e15fdf9c9 Mon Sep 17 00:00:00 2001 From: Keyur Panchal Date: Mon, 21 Oct 2024 14:31:47 -0600 Subject: [PATCH] Add Ensure to fix coverity defect (#7338) Coverity detected a possible null pointer dereference. It doesn't seem like this can be triggered, so added an `Ensure` clause. Disable-check: force-changelog-file --- src/import/ht_hypertable_modify.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/import/ht_hypertable_modify.c b/src/import/ht_hypertable_modify.c index 436af278a..188f7b392 100644 --- a/src/import/ht_hypertable_modify.c +++ b/src/import/ht_hypertable_modify.c @@ -11,6 +11,7 @@ * the PostgreSQL License. */ #include +#include "debug_assert.h" #include #include #include @@ -743,6 +744,7 @@ lmerge_matched:; * tuple, for the refetch we do at * the top. */ + Ensure(tupleid != NULL, "matched tupleid during merge cannot be null"); ItemPointerCopy(&context->tmfd.ctid, tupleid); goto lmerge_matched;