[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE_3_1_BRANCH: kdelibs/khtml/xml
From:       David Faure <faure () kde ! org>
Date:       2003-06-24 11:44:59
[Download RAW message or body]

CVS commit by faure: 

Backport rev 1.94:
Check for negative count value in substringData(), deleteData() and
replaceData(). Fixes crash on characterdataindexsizeerrdeletedatacountnegative
in dom 1 core test suite.


  M +12 -3     dom_textimpl.cpp   1.89.2.3


--- kdelibs/khtml/xml/dom_textimpl.cpp  #1.89.2.2:1.89.2.3
@@ -76,4 +76,7 @@ DOMString CharacterDataImpl::substringDa
 {
     exceptioncode = 0;
+    if ((long)count < 0)
+        exceptioncode = DOMException::INDEX_SIZE_ERR;
+    else
     checkCharDataOperation(offset, exceptioncode);
     if (exceptioncode)
@@ -127,4 +130,7 @@ void CharacterDataImpl::deleteData( cons
 {
     exceptioncode = 0;
+    if ((long)count < 0)
+        exceptioncode = DOMException::INDEX_SIZE_ERR;
+    else
     checkCharDataOperation(offset, exceptioncode);
     if (exceptioncode)
@@ -146,4 +152,7 @@ void CharacterDataImpl::replaceData( con
 {
     exceptioncode = 0;
+    if ((long)count < 0)
+        exceptioncode = DOMException::INDEX_SIZE_ERR;
+    else
     checkCharDataOperation(offset, exceptioncode);
     if (exceptioncode)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic