Bug 1241522 - handle OOM in nsExpatDriver::HandleCharacterData; r=hsivonen

This commit is contained in:
Nathan Froyd 2016-01-21 11:36:36 -05:00
parent 4c7adabd69
commit 770998a55d

View File

@ -33,6 +33,7 @@
#include "mozilla/Logging.h"
using mozilla::fallible;
using mozilla::LogLevel;
#define kExpatSeparatorChar 0xFFFF
@ -415,7 +416,9 @@ nsExpatDriver::HandleCharacterData(const char16_t *aValue,
NS_ASSERTION(mSink, "content sink not found!");
if (mInCData) {
mCDataText.Append(aValue, aLength);
if (!mCDataText.Append(aValue, aLength, fallible)) {
MaybeStopParser(NS_ERROR_OUT_OF_MEMORY);
}
}
else if (mSink) {
nsresult rv = mSink->HandleCharacterData(aValue, aLength);