From d3b60aa648079e29f74e3e0fa1316e4eb3014ad9 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sun, 19 Jan 2014 17:23:32 +0100 Subject: CID#706118: possibly invalid cast --- basic/source/classes/sb.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'basic') diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 84dac3f2c794..496108da61b7 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1892,9 +1892,11 @@ sal_Bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer ) r >> nMod; for( sal_uInt16 i = 0; i < nMod; i++ ) { - SbModule* pMod = (SbModule*) SbxBase::Load( r ); + SbxBase* pBase = SbxBase::Load( r ); + SbModule* pMod = dynamic_cast(pBase); if( !pMod ) { + delete pBase; return sal_False; } else if( pMod->ISA(SbJScriptModule) ) -- cgit