xzyang / rpms / libxml2

Forked from rpms/libxml2 3 years ago
Clone

Blame SOURCES/libxml2-Bug-757711-heap-buffer-overflow-in-xmlFAParsePosCharGroup-https-bugzilla.gnome.org-show_bug.cgi-id-757711.patch

6dedca
From 367c602b42f1afe7ed50508b01491b5690d54d52 Mon Sep 17 00:00:00 2001
6dedca
From: Pranjal Jumde <pjumde@apple.com>
6dedca
Date: Mon, 7 Mar 2016 06:34:26 -0800
6dedca
Subject: [PATCH] Bug 757711: heap-buffer-overflow in xmlFAParsePosCharGroup
6dedca
 <https://bugzilla.gnome.org/show_bug.cgi?id=757711>
6dedca
To: libvir-list@redhat.com
6dedca
6dedca
* xmlregexp.c:
6dedca
(xmlFAParseCharRange): Only advance to the next character if
6dedca
there is no error.  Advancing to the next character in case of
6dedca
an error while parsing regexp leads to an out of bounds access.
6dedca
6dedca
Signed-off-by: Daniel Veillard <veillard@redhat.com>
6dedca
---
6dedca
 xmlregexp.c | 3 ++-
6dedca
 1 file changed, 2 insertions(+), 1 deletion(-)
6dedca
6dedca
diff --git a/xmlregexp.c b/xmlregexp.c
6dedca
index 1f9911c..eb67b74 100644
6dedca
--- a/xmlregexp.c
6dedca
+++ b/xmlregexp.c
6dedca
@@ -5050,11 +5050,12 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) {
6dedca
 	ERROR("Expecting the end of a char range");
6dedca
 	return;
6dedca
     }
6dedca
-    NEXTL(len);
6dedca
+
6dedca
     /* TODO check that the values are acceptable character ranges for XML */
6dedca
     if (end < start) {
6dedca
 	ERROR("End of range is before start of range");
6dedca
     } else {
6dedca
+        NEXTL(len);
6dedca
         xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg,
6dedca
 		           XML_REGEXP_CHARVAL, start, end, NULL);
6dedca
     }
6dedca
-- 
6dedca
2.5.5
6dedca