]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Taming static checker: Fixed hypothetical adata comparator crash
authorMaria Matejka <mq@ucw.cz>
Thu, 13 Feb 2025 09:22:08 +0000 (10:22 +0100)
committerMaria Matejka <mq@ucw.cz>
Mon, 10 Mar 2025 10:19:01 +0000 (11:19 +0100)
lib/attrs.h

index ae9de9c642813689e07a6f527f97fecdb5c10ef7..b57348d5ae2f887d126b9d9dcf759ae5d159c443 100644 (file)
@@ -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)); }