Initialize the output buffer length in order to avoid infinite loop, bug 34859, r=ftang, a=leaf.

This commit is contained in:
nhotta%netscape.com 2000-04-07 23:58:59 +00:00
Родитель 6fdba025f1
Коммит 52b25adc68
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -313,6 +313,7 @@ PRBool nsMsgI18N7bit_data_part(const char *charset, const char *inString, const
// convert to unicode
while (consumedLen < size) {
srcLen = ((size - consumedLen) >= 512) ? 512 : (size - consumedLen); // buffer len or remaining src len
unicharLength = 512;
res = decoder->Convert(currentSrcPtr, &srcLen, unicharBuff, &unicharLength);
if (NS_FAILED(res))
break;