From 332a67afdc3d3c89c272aa3871e780cd30f34b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 4 Jun 2014 11:19:51 +0100 Subject: [PATCH] coverity#736759 Dereference before null check Change-Id: Ia36e192d32c46a5c1129eca050b2863ec1213bb4 --- connectivity/source/drivers/file/fcode.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx index 9c18fb23579c..2f6ced4655b2 100644 --- a/connectivity/source/drivers/file/fcode.cxx +++ b/connectivity/source/drivers/file/fcode.cxx @@ -413,11 +413,12 @@ void ONthOperator::Exec(OCodeStack& rCodeStack) OSL_ENSURE(!rCodeStack.empty(),"Stack must be none empty!"); pOperand = rCodeStack.top(); rCodeStack.pop(); - if ( !IS_TYPE(OStopOperand,pOperand) ) + assert(pOperand); + if (pOperand && !IS_TYPE(OStopOperand,pOperand)) aValues.push_back( pOperand->getValue() ); aOperands.push_back( pOperand ); } - while ( !IS_TYPE(OStopOperand,pOperand) ); + while (pOperand && !IS_TYPE(OStopOperand,pOperand)); rCodeStack.push(new OOperandResult(operate(aValues)));