From 2a55d19fdf091fd3a3f0d224fd6b4e94649a7bae Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Thu, 22 Aug 2013 08:52:50 -0400 Subject: [PATCH] bug 750932 - multipart delimiter check r=jduell --- netwerk/streamconv/converters/nsMultiMixedConv.cpp | 3 ++- netwerk/test/unit/xpcshell.ini | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/netwerk/streamconv/converters/nsMultiMixedConv.cpp b/netwerk/streamconv/converters/nsMultiMixedConv.cpp index 024c057ce04f..2a44ab0f2b07 100644 --- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp +++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp @@ -565,7 +565,8 @@ nsMultiMixedConv::OnDataAvailable(nsIRequest *request, nsISupports *context, int32_t tokenLinefeed = 1; while ( (token = FindToken(cursor, bufLen)) ) { - if (*(token+mTokenLen+1) == '-') { + if (((token + mTokenLen) < (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; diff --git a/netwerk/test/unit/xpcshell.ini b/netwerk/test/unit/xpcshell.ini index a577e0833318..171c09a5737e 100644 --- a/netwerk/test/unit/xpcshell.ini +++ b/netwerk/test/unit/xpcshell.ini @@ -129,8 +129,6 @@ skip-if = bits != 32 [test_multipart_byteranges.js] [test_multipart_streamconv.js] [test_multipart_streamconv_missing_lead_boundary.js] -# Bug 750932: test fails under AddressSanitizer -fail-if = asan [test_nestedabout_serialize.js] [test_net_addr.js] # Bug 732363: test fails on windows for unknown reasons.