summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/argp-standalone/files/0002-isprint.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-12-17 08:51:39 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-24 09:40:26 +0000
commit1a6fe71e7ec2a65fe62332fa899363cf71ecc5f5 (patch)
tree040aeae2b53cdfee5db27054c7482ceff0121681 /meta/recipes-support/argp-standalone/files/0002-isprint.patch
parenta7d780c1bc3383514d0a2c04661203eede59b82d (diff)
downloadpoky-1a6fe71e7ec2a65fe62332fa899363cf71ecc5f5.tar.gz
argp-standalone: Add recipe
This helps packages like gnutls to compile with musl any package that needs glibc's implementation of argp can link to this library (From OE-Core rev: d2bb8bb1406ef1ca53539912a463bd518211110a) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/argp-standalone/files/0002-isprint.patch')
-rw-r--r--meta/recipes-support/argp-standalone/files/0002-isprint.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-support/argp-standalone/files/0002-isprint.patch b/meta/recipes-support/argp-standalone/files/0002-isprint.patch
new file mode 100644
index 0000000000..1c07eea3c1
--- /dev/null
+++ b/meta/recipes-support/argp-standalone/files/0002-isprint.patch
@@ -0,0 +1,51 @@
1Subject: restrict value range passed to isprint function
2
3According to C standards isprint argument shall be representable as an
4unsigned char or be equal to EOF, otherwise the behaviour is undefined.
5
6Passing arbitrary ints leads to segfault in nm program from elfutils.
7
8Restrict isprint argument range to values representable by unsigned char.
9
10Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
11
12Taken from buildroot
13
14Upstream-Status: Pending
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16
17---
18Index: b/argp.h
19===================================================================
20--- a/argp.h
21+++ b/argp.h
22@@ -23,6 +23,7 @@
23
24 #include <stdio.h>
25 #include <ctype.h>
26+#include <limits.h>
27
28 #define __need_error_t
29 #include <errno.h>
30@@ -577,7 +578,7 @@
31 else
32 {
33 int __key = __opt->key;
34- return __key > 0 && isprint (__key);
35+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
36 }
37 }
38
39Index: b/argp-parse.c
40===================================================================
41--- a/argp-parse.c
42+++ b/argp-parse.c
43@@ -1292,7 +1292,7 @@
44 int __key = __opt->key;
45 /* FIXME: whether or not a particular key implies a short option
46 * ought not to be locale dependent. */
47- return __key > 0 && isprint (__key);
48+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
49 }
50 }
51