DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6122>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6122 DOMString::transcode() maybe have something wrong, [EMAIL PROTECTED] changed: What |Removed |Added ---------------------------------------------------------------------------- OS/Version|Windows NT/2K |FreeBSD Priority|Other |Medium Version|1.6.0 |1.7.0 ------- Additional Comments From [EMAIL PROTECTED] 2002-05-24 22:23 ------- If the size esitimate fails, retP should be capped at charsNeeded2, not at charsNeeded. This patch fixes the bug. $ diff -c DOMString.cpp.orig DOMString.cpp *** DOMString.cpp.orig Sat May 25 06:57:51 2002 --- DOMString.cpp Sat May 25 06:46:55 2002 *************** *** 1099,1110 **** --- 1099,1112 ---- // we start with this estimate, and if overflow, then call calcRequiredSize for actual size const unsigned int charsNeeded = fHandle->fLength; char* retP = new char[charsNeeded + 1]; + retP[charsNeeded] = 0; if (!getDomConverter()->transcode(srcP, retP, charsNeeded)) { delete [] retP; const unsigned int charsNeeded2 = getDomConverter()->calcRequiredSize(srcP); retP = new char[charsNeeded2 + 1]; + retP[charsNeeded2] = 0; if (!getDomConverter()->transcode(srcP, retP, charsNeeded2)) { // <TBD> We should throw something here? *************** *** 1112,1119 **** } delete [] allocatedBuf; // which will be null if we didn't allocate one. - // Cap it off and return it - retP[charsNeeded] = 0; return retP; } --- 1114,1119 ---- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
