Bug 1321612. r=valentin, a=jcristau
authorHonza Bambas <honzab.moz@firemni.cz>
Thu, 23 Feb 2017 13:18:55 -0500
changeset 492877 6e16e25f11e90647f9b3dc6f0500793fcd94d79b
parent 492876 26c625adfe63bc344775dbfee4b4ad935f668b02
child 492878 3ba4a9e4bf358d5305c31ce9b9cd187f74cf563c
push id47617
push userbmo:rail@mozilla.com
push dateFri, 03 Mar 2017 03:42:47 +0000
reviewersvalentin, jcristau
bugs1321612
milestone52.0
Bug 1321612. r=valentin, a=jcristau
netwerk/streamconv/converters/nsMultiMixedConv.cpp
--- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp
+++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp
@@ -591,17 +591,17 @@ nsMultiMixedConv::OnDataAvailable(nsIReq
             rv = SendStart(channel);
             if (NS_FAILED(rv)) return rv;
         }
     }
 
     int32_t tokenLinefeed = 1;
     while ( (token = FindToken(cursor, bufLen)) ) {
 
-        if (((token + mTokenLen) < (cursor + bufLen)) &&
+        if (((token + mTokenLen + 1) < (cursor + bufLen)) &&
             (*(token + mTokenLen + 1) == '-')) {
             // This was the last delimiter so we can stop processing
             rv = SendData(cursor, LengthToToken(cursor, token));
             if (NS_FAILED(rv)) return rv;
             if (mPartChannel) {
                 mPartChannel->SetIsLastPart();
             }
             return SendStop(NS_OK);