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

List:       xerces-c-dev
Subject:    [jira] Created: (XERCESC-1775) DOMString (deprecated) corruption
From:       "Maxim Volkonovsky (JIRA)" <xerces-c-dev () xml ! apache ! org>
Date:       2008-01-25 20:16:34
Message-ID: 2421095.1201292194353.JavaMail.jira () brutus
[Download RAW message or body]

DOMString (deprecated) corruption
---------------------------------

                 Key: XERCESC-1775
                 URL: https://issues.apache.org/jira/browse/XERCESC-1775
             Project: Xerces-C++
          Issue Type: Bug
          Components: DOM
    Affects Versions: 2.7.0, 2.8.0
         Environment: any
            Reporter: Maxim Volkonovsky


This bug was introduced in revision 176239 (probably to fix bug XERCESC-398). \
'clone'd string could be corrupted (truncated) by rawBuffer method. It comes from \
wrong assumption that DOMString (and rawBuffer returned from it) should be \
null-terminated.

The following code snippet reproduce the bug:

DOMString test, test2;

test = "OneTwo";
test2 = test.substringData(0, 3);


XERCES_STD_QUALIFIER cout << test.transcode() << XERCES_STD_QUALIFIER endl;
XERCES_STD_QUALIFIER cout << test2.transcode() << XERCES_STD_QUALIFIER endl;
XERCES_STD_QUALIFIER cout << test.transcode() << XERCES_STD_QUALIFIER endl;

transcode (which calls rawBuffer) for 'test2' string truncates 'test' string to 3 \
characters.

I suppose that the easiest way to fix it - is to rollback diff for revision 176239 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


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

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