Backport sizeof-pointer-memaccess upstream fixes.

This commit is contained in:
Mark Wielaard 2013-01-24 16:12:14 +01:00
parent 091b5a9425
commit e43443132c
2 changed files with 74 additions and 1 deletions

View File

@ -0,0 +1,68 @@
commit 1a4d0668d18bf1090c5c08cdb5cb3ba2b8eb5410
Author: David Abdurachmanov <David.Abdurachmanov@cern.ch>
Date: Sun Jan 13 16:44:21 2013 +0100
ar.c (do_oper_delete): Fix num passed to memset.
Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
diff --git a/src/ar.c b/src/ar.c
index 03da1b7..2d6ad60 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -919,7 +919,7 @@ do_oper_delete (const char *arfname, char **argv, int argc,
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;
commit 57bd66cabf6e6b9ecf622cdbf350804897a8df58
Author: Roland McGrath <roland@hack.frob.com>
Date: Tue Dec 11 09:42:07 2012 -0800
nm: Fix size passed to snprintf for invalid sh_name case.
Signed-off-by: Roland McGrath <roland@hack.frob.com>
diff --git a/src/nm.c b/src/nm.c
index f50da0b..8a1c57a 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -769,8 +769,9 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx, const char *fullname,
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 "]",
+ const size_t bufsz = sizeof "[invalid sh_name 0x12345678]"
+ name = alloca (bufsz);
+ snprintf (name, bufsz, "[invalid sh_name %#" PRIx32 "]",
gelf_getshdr (scn, &shdr_mem)->sh_name);
}
scnnames[elf_ndxscn (scn)] = name;
commit 7df3d2cd70932cd70515dbeb75e4db66fd27f192
Author: Mark Wielaard <mjw@redhat.com>
Date: Tue Dec 11 22:27:05 2012 +0100
Add missing semicolon in show_symbols_sysv
Signed-off-by: Mark Wielaard <mjw@redhat.com>
diff --git a/src/nm.c b/src/nm.c
index 8a1c57a..7aae84b 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -769,7 +769,7 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx, const char *fullname,
gelf_getshdr (scn, &shdr_mem)->sh_name);
if (unlikely (name == NULL))
{
- const size_t bufsz = sizeof "[invalid sh_name 0x12345678]"
+ const size_t bufsz = sizeof "[invalid sh_name 0x12345678]";
name = alloca (bufsz);
snprintf (name, bufsz, "[invalid sh_name %#" PRIx32 "]",
gelf_getshdr (scn, &shdr_mem)->sh_name);

View File

@ -1,7 +1,7 @@
Name: elfutils Name: elfutils
Summary: A collection of utilities and DSOs to handle compiled objects Summary: A collection of utilities and DSOs to handle compiled objects
Version: 0.155 Version: 0.155
%global baserelease 2 %global baserelease 3
URL: https://fedorahosted.org/elfutils/ URL: https://fedorahosted.org/elfutils/
%global source_url http://fedorahosted.org/releases/e/l/elfutils/%{version}/ %global source_url http://fedorahosted.org/releases/e/l/elfutils/%{version}/
License: GPLv3+ and (GPLv2+ or LGPLv3+) License: GPLv3+ and (GPLv2+ or LGPLv3+)
@ -47,6 +47,7 @@ Patch1: %{?source_url}elfutils-robustify.patch
Patch2: %{?source_url}elfutils-portability.patch Patch2: %{?source_url}elfutils-portability.patch
Patch3: elfutils-0.155-binutils-pr-ld-13621.patch Patch3: elfutils-0.155-binutils-pr-ld-13621.patch
Patch4: elfutils-0.155-mem-align.patch Patch4: elfutils-0.155-mem-align.patch
Patch5: elfutils-0.155-sizeof-pointer-memaccess.patch
%if !%{compat} %if !%{compat}
Release: %{baserelease}%{?dist} Release: %{baserelease}%{?dist}
@ -213,6 +214,7 @@ sed -i.scanf-m -e 's/%m/%a/g' src/addr2line.c tests/line2addr.c
%patch3 -p1 -b .binutils-pr-ld-13621 %patch3 -p1 -b .binutils-pr-ld-13621
%patch4 -p1 -b .mem-align %patch4 -p1 -b .mem-align
%patch5 -p1 -b .sizeof-pointer-memaccess
find . -name \*.sh ! -perm -0100 -print | xargs chmod +x find . -name \*.sh ! -perm -0100 -print | xargs chmod +x
@ -329,6 +331,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/libelf.a %{_libdir}/libelf.a
%changelog %changelog
* Thu Jan 24 2013 Mark Wielaard <mjw@redhat.com> - 0.155-3
- Backport sizeof-pointer-memaccess upstream fixes.
* Thu Jan 10 2013 Mark Wielaard <mjw@redhat.com> - 0.155-2 * Thu Jan 10 2013 Mark Wielaard <mjw@redhat.com> - 0.155-2
- #891553 - unaligned memory access issues. - #891553 - unaligned memory access issues.