asan: Buffer overflow in evax_bfd_print_dst
[binutils-gdb.git] / bfd / elf32-m32r.c
index 783632b65186dcd5f1d8b8988075d8954520c8eb..825cb23bbb6ef9fbb5ec6f131ad185a4ce8de3cb 100644 (file)
@@ -1,5 +1,5 @@
 /* M32R-specific support for 32-bit ELF.
-   Copyright (C) 1996-2021 Free Software Foundation, Inc.
+   Copyright (C) 1996-2022 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -3615,8 +3615,8 @@ m32r_elf_section_flags (const Elf_Internal_Shdr *hdr)
 {
   const char *name = hdr->bfd_section->name;
 
-  if (strncmp (name, ".sbss", 5) == 0
-      || strncmp (name, ".sdata", 6) == 0)
+  if (startswith (name, ".sbss")
+      || startswith (name, ".sdata"))
     hdr->bfd_section->flags |= SEC_SMALL_DATA;
 
   return true;