Fix an off-by-one error with undefined codepoints. Bug 564679, r=Masatoshi Kimura <VYV03354@nifty.ne.jp>
authorSimon Montagu <smontagu@smontagu.org>
Tue, 11 May 2010 17:38:25 +0300
changeset 42128 96edff6785272e6279a34136f382dbaf1b60990a
parent 42127 15cec4043fba4c3706421945f439434acf7e522a
child 42129 93874cf6d6ba752200d0b4821a720058aaa2ca86
push idunknown
push userunknown
push dateunknown
reviewersMasatoshi
bugs564679
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Fix an off-by-one error with undefined codepoints. Bug 564679, r=Masatoshi Kimura <VYV03354@nifty.ne.jp>
intl/uconv/util/nsUnicodeDecodeHelper.cpp
--- a/intl/uconv/util/nsUnicodeDecodeHelper.cpp
+++ b/intl/uconv/util/nsUnicodeDecodeHelper.cpp
@@ -231,21 +231,22 @@ nsresult nsUnicodeDecodeHelper::ConvertB
     srcEnd += (*aDestLength);
     res = NS_PARTIAL_MORE_OUTPUT;
   } else {
     srcEnd += (*aSrcLength);
     res = NS_OK;
   }
 
   for (; src<srcEnd;) {
-    *dest = aFastTable[*src++];
+    *dest = aFastTable[*src];
     if (*dest == 0xfffd && aErrorSignal) {
       res = NS_ERROR_ILLEGAL_INPUT;
       break;
     }
+    src++;
     dest++;
   }
 
   *aSrcLength = src - (PRUint8 *)aSrc;
   *aDestLength  = dest - aDest;
   return res;
 }