From da442b4ecd27f19d003358c0f8c3c4e026be4074 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Thu, 13 Feb 2025 10:22:08 +0100 Subject: [PATCH] Taming static checker: Fixed hypothetical adata comparator crash --- lib/attrs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/attrs.h b/lib/attrs.h index ae9de9c64..b57348d5a 100644 --- a/lib/attrs.h +++ b/lib/attrs.h @@ -43,7 +43,7 @@ lp_store_adata(struct linpool *pool, const void *buf, uint len) #define tmp_copy_adata(ad) tmp_store_adata((ad)->data, (ad)->length) static inline int adata_same(const struct adata *a, const struct adata *b) -{ return (!a && !b) || (a->length == b->length && !memcmp(a->data, b->data, a->length)); } +{ return (!a && !b) || a && b && (a->length == b->length && !memcmp(a->data, b->data, a->length)); } -- 2.47.2