]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Taming static checker: don't memcpy zero length
authorMaria Matejka <mq@ucw.cz>
Fri, 31 Jan 2025 22:51:44 +0000 (23:51 +0100)
committerMaria Matejka <mq@ucw.cz>
Mon, 10 Mar 2025 10:17:11 +0000 (11:17 +0100)
lib/attrs.h

index c622fc0aa637524555c0dab267ef6ea523e9cd08..ae9de9c642813689e07a6f527f97fecdb5c10ef7 100644 (file)
@@ -33,7 +33,8 @@ static inline struct adata *
 lp_store_adata(struct linpool *pool, const void *buf, uint len)
 {
   struct adata *ad = lp_alloc_adata(pool, len);
-  memcpy(ad->data, buf, len);
+  if (len)
+    memcpy(ad->data, buf, len);
   return ad;
 }