diff --git a/elfutils-sizeof-pointer-memaccess.patch b/elfutils-sizeof-pointer-memaccess.patch new file mode 100644 index 0000000..0e88313 --- /dev/null +++ b/elfutils-sizeof-pointer-memaccess.patch @@ -0,0 +1,38 @@ +Index: elfutils-0.155/src/ar.c +=================================================================== +--- elfutils-0.155.orig/src/ar.c ++++ elfutils-0.155/src/ar.c +@@ -461,7 +461,7 @@ do_oper_extract (int oper, const char *a + long int instance) + { + bool found[argc]; +- memset (found, '\0', sizeof (found)); ++ memset (found, '\0', sizeof (bool) * argc); + + size_t name_max = 0; + inline bool should_truncate_fname (void) +@@ -919,7 +919,7 @@ do_oper_delete (const char *arfname, cha + long int instance) + { + bool *found = alloca (sizeof (bool) * argc); +- memset (found, '\0', sizeof (found)); ++ memset (found, '\0', sizeof (bool) * argc); + + /* List of the files we keep. */ + struct armem *to_copy = NULL; +Index: elfutils-0.155/src/nm.c +=================================================================== +--- elfutils-0.155.orig/src/nm.c ++++ elfutils-0.155/src/nm.c +@@ -769,8 +769,9 @@ show_symbols_sysv (Ebl *ebl, GElf_Word s + gelf_getshdr (scn, &shdr_mem)->sh_name); + if (unlikely (name == NULL)) + { +- name = alloca (sizeof "[invalid sh_name 0x12345678]"); +- snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]", ++ size_t len = sizeof "[invalid sh_name 0x12345678]"; ++ name = alloca (len); ++ snprintf (name, len, "[invalid sh_name %#" PRIx32 "]", + gelf_getshdr (scn, &shdr_mem)->sh_name); + } + scnnames[elf_ndxscn (scn)] = name; diff --git a/elfutils.changes b/elfutils.changes index 415cb0f..3e133b2 100644 --- a/elfutils.changes +++ b/elfutils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 18 16:05:13 UTC 2013 - schwab@suse.de + +- elfutils-sizeof-pointer-memaccess.patch: Fix sizeof-pointer-memaccess + warnings + ------------------------------------------------------------------- Tue Mar 26 12:56:03 UTC 2013 - mmeister@suse.com diff --git a/elfutils.spec b/elfutils.spec index ab4bdda..10401cd 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -35,6 +35,7 @@ Patch6: elfutils-0.137-dwarf-header-check-fix.diff Patch7: elfutils-0.148-dont-crash.diff Patch8: elfutils-revert-portability-scanf.patch Patch9: elfutils-aarch64.patch +Patch10: elfutils-sizeof-pointer-memaccess.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: flex @@ -146,6 +147,7 @@ to develop applications that require these. %patch7 -p1 %patch8 -p1 -R %patch9 -p1 +%patch10 -p1 %build # Change DATE/TIME macros to use last change time of elfutils.changes