Skip to content

Commit 89baa58

Browse files
committed
fix: use memcmp for binary data comparison in cmp_strings function
1 parent e61b7ba commit 89baa58

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/value/value.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static inline mempool_t *getPool() {
4848

4949
static inline int cmp_strings(const char *s1, const char *s2, size_t l1, size_t l2) {
5050
// Use memcmp instead of strncmp to correctly handle binary data with embedded NULLs
51-
int cmp = strncmp(s1, s2, MIN(l1, l2));
51+
int cmp = memcmp(s1, s2, MIN(l1, l2));
5252
if (l1 == l2) {
5353
// if the strings are the same length, just return the result of memcmp
5454
return cmp;

0 commit comments

Comments
 (0)