From: Maria Matejka Date: Thu, 13 Feb 2025 09:22:08 +0000 (+0100) Subject: Taming static checker: Fixed hypothetical adata comparator crash X-Git-Tag: v3.1.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15bd7100cb6024478ffe98961f02c3a428f83e15;p=thirdparty%2Fbird.git Taming static checker: Fixed hypothetical adata comparator crash --- 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)); }