Skip to content

Commit 2bc6ea6

Browse files
committed
Add suppressions
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
1 parent 758a7cd commit 2bc6ea6

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

src/cluster.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,7 @@ static dict *parse_cluster_nodes(valkeyClusterContext *cc, valkeyContext *c, val
973973
}
974974
}
975975
/* Retain parsed replica nodes until all primaries are parsed. */
976+
// codechecker_false_positive [core.CallAndMessage] primary_id is always initialized via parsed_primary_id when role is replica
976977
if (retain_replica_node(replicas, primary_id, node) != VALKEY_OK) {
977978
freeValkeyClusterNode(node);
978979
goto oom;

src/command.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ void valkey_parse_cmd(struct cmd *r) {
260260
continue; /* Keyword can't appear in a position before 'startfrom' */
261261
if (!strncasecmp(keyword, arg, arglen)) {
262262
/* Keyword found. Now the first key is the next arg. */
263+
// codechecker_false_positive [deadcode.DeadStores] p is used in the NULL check
263264
if ((p = valkey_parse_bulk(p, end, &arg, &arglen)) == NULL)
264265
goto error;
265266
/* Keep found key. */
@@ -289,6 +290,7 @@ void valkey_parse_cmd(struct cmd *r) {
289290
if (!strncmp("0", arg, arglen))
290291
goto done; /* No args. */
291292
/* One or more args. The first key is the arg after the 'numkeys' arg. */
293+
// codechecker_false_positive [deadcode.DeadStores] p is used in the NULL check
292294
if ((p = valkey_parse_bulk(p, end, &arg, &arglen)) == NULL)
293295
goto error;
294296
argidx++;

src/valkey_private.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static inline int valkeyContextUpdateConnectTimeout(valkeyContext *c,
103103
return VALKEY_ERR;
104104
}
105105

106+
// codechecker_false_positive [core.NonNullParamChecker] NULL is handled by pointer equality check above
106107
memcpy(c->connect_timeout, timeout, sizeof(*c->connect_timeout));
107108
return VALKEY_OK;
108109
}
@@ -120,6 +121,7 @@ static inline int valkeyContextUpdateCommandTimeout(valkeyContext *c,
120121
return VALKEY_ERR;
121122
}
122123

124+
// codechecker_false_positive [core.NonNullParamChecker] NULL is handled by pointer equality check above
123125
memcpy(c->command_timeout, timeout, sizeof(*c->command_timeout));
124126
return VALKEY_OK;
125127
}

tests/client_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ static void test_format_commands(void) {
455455
sds_cmd = NULL;
456456
test("Format command into sds by passing argc/argv without lengths: ");
457457
len = valkeyFormatSdsCommandArgv(&sds_cmd, argc, argv, NULL);
458+
// codechecker_false_positive [core.NonNullParamChecker] sds_cmd is set by valkeyFormatSdsCommandArgv
458459
test_cond(strncmp(sds_cmd, "*3\r\n$3\r\nSET\r\n$3\r\nfoo\r\n$3\r\nbar\r\n", len) == 0 &&
459460
len == 4 + 4 + (3 + 2) + 4 + (3 + 2) + 4 + (3 + 2));
460461
sdsfree(sds_cmd);

0 commit comments

Comments
 (0)