Skip to content

Commit

Permalink
Fix zipmap test null pointer (valkey-io#975)
Browse files Browse the repository at this point in the history
The previous test does a strncmp on a NULL, which is not valid. It
should be using an empty length string instead. Addresses
https://github.com/valkey-io/valkey/actions/runs/10649272046/job/29519233939.

Signed-off-by: Madelyn Olson <[email protected]>
  • Loading branch information
madolson authored Sep 1, 2024
1 parent e3af1a3 commit 089048d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unit/test_zipmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int test_zipmapIterateThroughElements(int argc, char *argv[], int flags) {
unsigned char *key, *value;
unsigned int klen, vlen;
char *expected_key[] = {"name", "surname", "age", "hello", "foo", "noval"};
char *expected_value[] = {"foo", "foo", "foo", "world!", "12345", NULL};
char *expected_value[] = {"foo", "foo", "foo", "world!", "12345", ""};
unsigned int expected_klen[] = {4, 7, 3, 5, 3, 5};
unsigned int expected_vlen[] = {3, 3, 3, 6, 5, 0};
int iter = 0;
Expand Down

0 comments on commit 089048d

Please sign in to comment.