зеркало из https://github.com/mozilla/pjs.git
Bug 220703: return either error or return to avoid crashes and leaks
r/sr=peterv
This commit is contained in:
Родитель
7f75803106
Коммит
634670ab75
|
@ -125,9 +125,6 @@ txExprLexer::parse(const nsASingleFragmentString& aPattern)
|
|||
iterator start, end;
|
||||
start = aPattern.BeginReading(mPosition);
|
||||
aPattern.EndReading(end);
|
||||
if (start == end) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-- initialize previous token, this will automatically get
|
||||
//-- deleted when it goes out of scope
|
||||
|
|
|
@ -179,9 +179,6 @@ txExprParser::createExpr(const nsASingleFragmentString& aExpression,
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aExpr);
|
||||
*aExpr = nsnull;
|
||||
if (aExpression.IsEmpty()) {
|
||||
return NS_OK;
|
||||
}
|
||||
txExprLexer lexer;
|
||||
nsresult rv = lexer.parse(aExpression);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -192,6 +189,8 @@ txExprParser::createExpr(const nsASingleFragmentString& aExpression,
|
|||
}
|
||||
rv = createExpr(lexer, aContext, aExpr);
|
||||
if (NS_SUCCEEDED(rv) && lexer.peek()->mType != Token::END) {
|
||||
delete *aExpr;
|
||||
*aExpr = nsnull;
|
||||
rv = NS_ERROR_XPATH_BINARY_EXPECTED;
|
||||
}
|
||||
if (NS_FAILED(rv)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче