summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/elfutils/elfutils-0.148/0002-Fix-printf-overflow-warnings.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/elfutils/elfutils-0.148/0002-Fix-printf-overflow-warnings.patch')
-rw-r--r--recipes-devtools/elfutils/elfutils-0.148/0002-Fix-printf-overflow-warnings.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/recipes-devtools/elfutils/elfutils-0.148/0002-Fix-printf-overflow-warnings.patch b/recipes-devtools/elfutils/elfutils-0.148/0002-Fix-printf-overflow-warnings.patch
new file mode 100644
index 0000000..bc89f04
--- /dev/null
+++ b/recipes-devtools/elfutils/elfutils-0.148/0002-Fix-printf-overflow-warnings.patch
@@ -0,0 +1,57 @@
1From 471f7e4e72feea16f06d806c47b05719c3d77d8f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 25 Apr 2017 15:57:33 -0700
4Subject: [PATCH 2/2] Fix printf overflow warnings
5
6Fixes
7
8../../elfutils-0.148/src/ar.c:865:49: error: '__builtin___snprintf_chk' output truncated before the last format character [-Werror=format-truncation=]
9 snprintf (tmpbuf, sizeof (tmpbuf), "/%-*ld",
10 ^
11In file included from /mnt/a/build/tmp-glibc/work/cortexa7hf-neon-vfpv4-oe-linux-gnueabi/elfutils/0.148-r11/recipe-sysroot/usr/include/stdio.h:889:0,
12 from /mnt/a/build/tmp-glibc/work/cortexa7hf-neon-vfpv4-oe-linux-gnueabi/elfutils/0.148-r11/recipe-sysroot/usr/include/argp.h:23,
13 from ../../elfutils-0.148/src/ar.c:30:
14/mnt/a/build/tmp-glibc/work/cortexa7hf-neon-vfpv4-oe-linux-gnueabi/elfutils/0.148-r11/recipe-sysroot/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output 18 b
15ytes into a destination of size 17
16
17Upstream-Status: Pending
18
19Signed-off-by: Khem Raj <raj.khem@gmail.com>
20---
21 src/ar.c | 6 +++---
22 1 file changed, 3 insertions(+), 3 deletions(-)
23
24diff --git a/src/ar.c b/src/ar.c
25index 8e2abbe..0bf5051 100644
26--- a/src/ar.c
27+++ b/src/ar.c
28@@ -853,7 +853,7 @@ write_member (struct armem *memb, off_t *startp, off_t *lenp, Elf *elf,
29 off_t end_off, int newfd)
30 {
31 struct ar_hdr arhdr;
32- char tmpbuf[sizeof (arhdr.ar_name) + 1];
33+ char tmpbuf[sizeof (arhdr.ar_name) + 2];
34
35 bool changed_header = memb->long_name_off != -1;
36 if (changed_header)
37@@ -1454,7 +1454,7 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
38
39 /* Create the header. */
40 struct ar_hdr arhdr;
41- char tmpbuf[sizeof (arhdr.ar_name) + 1];
42+ char tmpbuf[sizeof (arhdr.ar_name) + 2];
43 if (all->long_name_off == -1)
44 {
45 size_t namelen = strlen (all->name);
46@@ -1464,7 +1464,7 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
47 }
48 else
49 {
50- snprintf (tmpbuf, sizeof (arhdr.ar_name) + 1, "/%-*ld",
51+ snprintf (tmpbuf, sizeof (tmpbuf), "/%-*ld",
52 (int) sizeof (arhdr.ar_name), all->long_name_off);
53 memcpy (arhdr.ar_name, tmpbuf, sizeof (arhdr.ar_name));
54 }
55--
562.12.2
57