Skip to content
Snippets Groups Projects
Commit bb412625 authored by Neil Graham's avatar Neil Graham
Browse files

Fix for bug 21990. Thanks to Shin'ya Morino.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175181 13f79535-47bb-0310-9956-ffa450edef68
parent c3faa586
No related branches found
No related tags found
No related merge requests found
......@@ -907,7 +907,7 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode)
}
// If targetLen is not enough then buffer overflow might occur
if (err == U_BUFFER_OVERFLOW_ERROR)
if ((err == U_BUFFER_OVERFLOW_ERROR) || (err == U_STRING_NOT_TERMINATED_WARNING))
{
//
// Reset the error, delete the old buffer, allocate a new one,
......@@ -936,8 +936,6 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode)
return 0;
}
// Cap it off and return
retBuf[targetCap] = 0;
return retBuf;
}
......@@ -1010,7 +1008,7 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode,
}
// If targetLen is not enough then buffer overflow might occur
if (err == U_BUFFER_OVERFLOW_ERROR)
if ((err == U_BUFFER_OVERFLOW_ERROR) || (err == U_STRING_NOT_TERMINATED_WARNING))
{
//
// Reset the error, delete the old buffer, allocate a new one,
......@@ -1039,8 +1037,6 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode,
return 0;
}
// Cap it off and return
retBuf[targetCap] = 0;
return retBuf;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment