]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix -Wstringop-overflow warning in ecoff_link_hash_newfunc
authorAndreas Schwab <schwab@suse.de>
Thu, 26 Sep 2024 11:06:25 +0000 (13:06 +0200)
committerAndreas Schwab <schwab@suse.de>
Thu, 26 Sep 2024 11:56:44 +0000 (13:56 +0200)
* ecoff.c (ecoff_link_hash_newfunc): Don't call memset if ret is
NULL.

bfd/ecoff.c

index 04501761bd6e1a171db713f041c74fbf5f2ba7dc..5ee7ffaf4898c7c562590ca9fa6ea5d9de56da30 100644 (file)
@@ -3278,8 +3278,8 @@ ecoff_link_hash_newfunc (struct bfd_hash_entry *entry,
       ret->abfd = NULL;
       ret->written = 0;
       ret->small = 0;
+      memset ((void *) &ret->esym, 0, sizeof ret->esym);
     }
-  memset ((void *) &ret->esym, 0, sizeof ret->esym);
 
   return (struct bfd_hash_entry *) ret;
 }