From: Gary Lockyer Date: Sun, 12 Oct 2025 20:44:49 +0000 (+1300) Subject: s4:kdc:db-glue-tests Fix CID 1666664 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6af2e180ce1c1e599d60fc6bfd5086216e92b040;p=thirdparty%2Fsamba.git s4:kdc:db-glue-tests Fix CID 1666664 Fix Coverity issue CID 1666664 115 char* ts = ldb_timestring(msg, created); >>> CID 1666664: Null pointer dereferences (NULL_RETURNS) >>> Dereferencing a pointer that might be "NULL" "ts" when calling >>> "ldb_msg_add_string". 116 ldb_msg_add_string(msg, "whenCreated", ts); Signed-off-by: Gary Lockyer Reviewed-by: Martin Schwenke --- diff --git a/source4/kdc/tests/db-glue-test.c b/source4/kdc/tests/db-glue-test.c index d98b143779d..2ff528b129c 100644 --- a/source4/kdc/tests/db-glue-test.c +++ b/source4/kdc/tests/db-glue-test.c @@ -113,6 +113,7 @@ static void add_whenCreated(struct ldb_message *msg, time_t created) { char* ts = ldb_timestring(msg, created); + assert_non_null(ts); ldb_msg_add_string(msg, "whenCreated", ts); }