(xerces-c) branch xerces-3.3 updated: XERCESC-2267 - Seg fault in regexp parser due to underflow

[email protected]
Newsgroups gmane.text.xml.xerces-c.devel
Message-ID <[email protected]>
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch xerces-3.3
in repository https://gitbox.apache.org/repos/asf/xerces-c.git


The following commit(s) were added to refs/heads/xerces-3.3 by this push:
     new e5a73625d XERCESC-2267 - Seg fault in regexp parser due to underflow
e5a73625d is described below

commit e5a73625d21f074465fa1820f3cb8d337a8b4e5c
Author: Scott Cantor <[email protected]>
AuthorDate: Thu Aug 13 12:48:44 2026 -0400

    XERCESC-2267 - Seg fault in regexp parser due to underflow
    
    https://issues.apache.org/jira/browse/XERCESC-2267
---
 src/xercesc/util/regx/RangeToken.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/xercesc/util/regx/RangeToken.cpp b/src/xercesc/util/regx/RangeToken.cpp
index d6c3cacbc..51ca9a01f 100644
--- a/src/xercesc/util/regx/RangeToken.cpp
+++ b/src/xercesc/util/regx/RangeToken.cpp
@@ -359,6 +359,9 @@ void RangeToken::addRange(const XMLInt32 start, const XMLInt32 end) {
         fSorted = true;
     }
     else {
+        if (fElemCount == 0) {
+                ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::Regex_NotSupported, fMemoryManager);
+        }
 
         if (fRanges[fElemCount-1] + 1 == val1) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.