gnu: expat: Fix regression caused by fix for CVE-2016-0718.
[jackhill/guix/guix.git] / gnu / packages / patches / expat-CVE-2016-0718-fix-regression.patch
1 Fix regression caused by fix for CVE-2016-0718 when building with -DXML_UNICODE.
2
3 Discussion:
4
5 https://sourceforge.net/p/expat/bugs/539/
6
7 Patch copied from upstream source repository:
8
9 https://sourceforge.net/p/expat/code_git/ci/af507cef2c93cb8d40062a0abe43a4f4e9158fb2/
10
11 From af507cef2c93cb8d40062a0abe43a4f4e9158fb2 Mon Sep 17 00:00:00 2001
12 From: Sebastian Pipping <sebastian@pipping.org>
13 Date: Sun, 17 Jul 2016 20:22:29 +0200
14 Subject: [PATCH 1/2] Fix regression bug #539 (needs -DXML_UNICODE)
15
16 Thanks to Andy Wang and Karl Waclawek!
17 ---
18 expat/lib/xmlparse.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21 diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
22 index b308e67..0d5dd7b 100644
23 --- a/lib/xmlparse.c
24 +++ b/lib/xmlparse.c
25 @@ -2468,7 +2468,7 @@ doContent(XML_Parser parser,
26 &fromPtr, rawNameEnd,
27 (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1);
28 convLen = (int)(toPtr - (XML_Char *)tag->buf);
29 - if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE)) {
30 + if ((fromPtr >= rawNameEnd) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE)) {
31 tag->name.strLen = convLen;
32 break;
33 }
34 --
35 2.10.0