diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-04-25 16:01:11 -0700 |
---|---|---|
committer | Ross Burton <ross.burton@intel.com> | 2017-04-26 10:31:27 +0100 |
commit | b0cdb6ffa9dd814865a0510115935ba2ced5827f (patch) | |
tree | b235c56fcf9dda9e5ff391cbe7462987fe77fca5 /recipes-devtools/elfutils/elfutils-0.148/0002-Fix-printf-overflow-warnings.patch | |
parent | fc0e3eae0f0669e6780ed69680cd065a77baca24 (diff) | |
download | meta-gplv2-b0cdb6ffa9dd814865a0510115935ba2ced5827f.tar.gz |
elfutils: Fix build with gcc7
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
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.patch | 57 |
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 @@ | |||
1 | From 471f7e4e72feea16f06d806c47b05719c3d77d8f Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 25 Apr 2017 15:57:33 -0700 | ||
4 | Subject: [PATCH 2/2] Fix printf overflow warnings | ||
5 | |||
6 | Fixes | ||
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 | ^ | ||
11 | In 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 | ||
15 | ytes into a destination of size 17 | ||
16 | |||
17 | Upstream-Status: Pending | ||
18 | |||
19 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
20 | --- | ||
21 | src/ar.c | 6 +++--- | ||
22 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
23 | |||
24 | diff --git a/src/ar.c b/src/ar.c | ||
25 | index 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 | -- | ||
56 | 2.12.2 | ||
57 | |||