From 0d8084ed6281e5f6e894315d61f196a887510f8d Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 16 Feb 2022 09:32:55 +1100 Subject: [PATCH] ctdb-protocol: CID 1499395: Uninitialized variables (UNINIT) Issue is reported here: 853 case CTDB_CONTROL_DB_VACUUM: { 854 struct ctdb_db_vacuum db_vacuum; 855 >>> CID 1499395: Uninitialized variables (UNINIT) >>> Using uninitialized value "db_vacuum.full_vacuum_run" when calling "ctdb_db_vacuum_len". 856 CHECK_CONTROL_DATA_SIZE(ctdb_db_vacuum_len(&db_vacuum)); 857 return ctdb_control_db_vacuum(ctdb, c, indata, async_reply); 858 } The problem is that ctdb_bool_len() unnecessarily dereferences its argument, which in this case is &db_vacuum.full_vacuum_run. Not a security issue because the value copied by dereferencing is not used. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Wed Feb 23 02:02:06 UTC 2022 on sn-devel-184 --- ctdb/protocol/protocol_basic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctdb/protocol/protocol_basic.c b/ctdb/protocol/protocol_basic.c index 94b18c1cd10..42f207790d0 100644 --- a/ctdb/protocol/protocol_basic.c +++ b/ctdb/protocol/protocol_basic.c @@ -162,7 +162,7 @@ int ctdb_double_pull(uint8_t *buf, size_t buflen, double *out, size_t *npull) size_t ctdb_bool_len(bool *in) { - uint8_t u8 = *in; + uint8_t u8 = 0; return ctdb_uint8_len(&u8); }