summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Avram <marius.avram@intel.com>2013-09-30 12:31:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-30 22:11:58 +0100
commit331159d90db7b115fc1422e761a7e73f956a4421 (patch)
tree80fa63123054e5b36d02668614953ce1df1362bf
parent58825b9b2077298312226e640f750632095d0d21 (diff)
downloadpoky-331159d90db7b115fc1422e761a7e73f956a4421.tar.gz
slang: fix sprintf bug concerning 8-bit characters
Buffer used for copying a "%c" character was getting out of scope when it was required by the sprintf operation. [YOCTO #5272] (From OE-Core rev: c7de71813c8f47438f44749136877442cf73d536) Signed-off-by: Marius Avram <marius.avram@intel.com> Signed-off-by: Irina Patru <irina.patru@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch42
-rw-r--r--meta/recipes-extended/slang/slang_2.2.4.bb1
2 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch b/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch
new file mode 100644
index 0000000000..ddf5cce5cb
--- /dev/null
+++ b/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch
@@ -0,0 +1,42 @@
1Upstream-Status: Backported
2
3From 3a05d1a920140e9f2c72791c12f664213feb46df Mon Sep 17 00:00:00 2001
4From: Manfred Hanke <Manfred.Hanke@tngtech.com>
5Date: Thu, 20 Jun 2013 10:24:12 +0200
6Subject: [PATCH] sprintf bug (concerning %c for 8-bit character in non-UTF8
7 mode) fixed
8
9char *str points to SLuchar_Type utf8_buf[], which had too small scope
10
11src/test/strops.sl failed in the following environment:
12 - compiler: gcc (Debian 4.7.2-5) 4.7.2
13 - CFLAGS: -g -O2
14 - libc: GNU C Library (Debian EGLIBC 2.13-38) stable release version 2.13
15 - kernel: 3.2.0-4-686-pae #1 SMP Debian 3.2.39-2 i686 GNU/Linux
16---
17 src/slstrops.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/src/slstrops.c b/src/slstrops.c
21index ce6acb0..cbbbb01 100644
22--- a/src/slstrops.c
23+++ b/src/slstrops.c
24@@ -1884,6 +1884,7 @@ static char *SLdo_sprintf (char *fmt) /*{{{*/
25 #endif
26 unsigned char uch;
27 int use_long = 0, use_alt_format = 0;
28+ SLuchar_Type utf8_buf[SLUTF8_MAX_MBLEN+1];
29
30 while (1)
31 {
32@@ -2071,7 +2072,6 @@ static char *SLdo_sprintf (char *fmt) /*{{{*/
33 #endif
34 {
35 SLwchar_Type wc;
36- SLuchar_Type utf8_buf[SLUTF8_MAX_MBLEN+1];
37
38 if (-1 == SLang_pop_wchar (&wc))
39 return out;
40--
411.7.9.5
42
diff --git a/meta/recipes-extended/slang/slang_2.2.4.bb b/meta/recipes-extended/slang/slang_2.2.4.bb
index f06caeb198..db5c6334f2 100644
--- a/meta/recipes-extended/slang/slang_2.2.4.bb
+++ b/meta/recipes-extended/slang/slang_2.2.4.bb
@@ -20,6 +20,7 @@ SRC_URI = "ftp://space.mit.edu/pub/davis/slang/v2.2/slang-${PV}.tar.bz2 \
20 file://rpathfix.patch \ 20 file://rpathfix.patch \
21 file://fix-check-pcre.patch \ 21 file://fix-check-pcre.patch \
22 file://change-char-type-to-signed-char-in-macros.patch \ 22 file://change-char-type-to-signed-char-in-macros.patch \
23 file://sprintf-bug-concerning-8-bit-characters.patch \
23 " 24 "
24 25
25inherit autotools 26inherit autotools