Magellan Linux

Contents of /trunk/elfutils/patches/elfutils-0.155-sizeof-pointer-memaccess.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2152 - (show annotations) (download)
Mon Apr 8 12:18:36 2013 UTC (11 years ago) by niro
File size: 2367 byte(s)
-fixed issues with gcc-4.8
1 commit 1a4d0668d18bf1090c5c08cdb5cb3ba2b8eb5410
2 Author: David Abdurachmanov <David.Abdurachmanov@cern.ch>
3 Date: Sun Jan 13 16:44:21 2013 +0100
4
5 ar.c (do_oper_delete): Fix num passed to memset.
6
7 Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
8
9 diff --git a/src/ar.c b/src/ar.c
10 index 03da1b7..2d6ad60 100644
11 --- a/src/ar.c
12 +++ b/src/ar.c
13 @@ -919,7 +919,7 @@ do_oper_delete (const char *arfname, char **argv, int argc,
14 long int instance)
15 {
16 bool *found = alloca (sizeof (bool) * argc);
17 - memset (found, '\0', sizeof (found));
18 + memset (found, '\0', sizeof (bool) * argc);
19
20 /* List of the files we keep. */
21 struct armem *to_copy = NULL;
22
23 commit 57bd66cabf6e6b9ecf622cdbf350804897a8df58
24 Author: Roland McGrath <roland@hack.frob.com>
25 Date: Tue Dec 11 09:42:07 2012 -0800
26
27 nm: Fix size passed to snprintf for invalid sh_name case.
28
29 Signed-off-by: Roland McGrath <roland@hack.frob.com>
30
31 diff --git a/src/nm.c b/src/nm.c
32 index f50da0b..8a1c57a 100644
33 --- a/src/nm.c
34 +++ b/src/nm.c
35 @@ -769,8 +769,9 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx, const char *fullname,
36 gelf_getshdr (scn, &shdr_mem)->sh_name);
37 if (unlikely (name == NULL))
38 {
39 - name = alloca (sizeof "[invalid sh_name 0x12345678]");
40 - snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]",
41 + const size_t bufsz = sizeof "[invalid sh_name 0x12345678]"
42 + name = alloca (bufsz);
43 + snprintf (name, bufsz, "[invalid sh_name %#" PRIx32 "]",
44 gelf_getshdr (scn, &shdr_mem)->sh_name);
45 }
46 scnnames[elf_ndxscn (scn)] = name;
47
48 commit 7df3d2cd70932cd70515dbeb75e4db66fd27f192
49 Author: Mark Wielaard <mjw@redhat.com>
50 Date: Tue Dec 11 22:27:05 2012 +0100
51
52 Add missing semicolon in show_symbols_sysv
53
54 Signed-off-by: Mark Wielaard <mjw@redhat.com>
55
56 diff --git a/src/nm.c b/src/nm.c
57 index 8a1c57a..7aae84b 100644
58 --- a/src/nm.c
59 +++ b/src/nm.c
60 @@ -769,7 +769,7 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx, const char *fullname,
61 gelf_getshdr (scn, &shdr_mem)->sh_name);
62 if (unlikely (name == NULL))
63 {
64 - const size_t bufsz = sizeof "[invalid sh_name 0x12345678]"
65 + const size_t bufsz = sizeof "[invalid sh_name 0x12345678]";
66 name = alloca (bufsz);
67 snprintf (name, bufsz, "[invalid sh_name %#" PRIx32 "]",
68 gelf_getshdr (scn, &shdr_mem)->sh_name);