Bug 1372839 - SkipString; Exit early if sym is not found r?gerald
MozReview-Commit-ID: GnqPuW8FL5F
--- a/media/gmp-clearkey/0.1/ClearKeyUtils.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeyUtils.cpp
@@ -231,16 +231,19 @@ static bool SkipToken(ParserContext& aCt
static bool
SkipString(ParserContext& aCtx)
{
EXPECT_SYMBOL(aCtx, '"');
for (uint8_t sym = GetNextSymbol(aCtx); sym; sym = GetNextSymbol(aCtx)) {
if (sym == '\\') {
sym = GetNextSymbol(aCtx);
+ if (!sym) {
+ return false;
+ }
} else if (sym == '"') {
return true;
}
}
return false;
}