[Libreoffice-commits] core.git: dbaccess/source

Norbert Thiebaud nthiebaud at gmail.com
Fri Jul 4 10:27:58 PDT 2014


 dbaccess/source/ui/misc/propertystorage.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 27e86fe677d24f99a22f51bbef2de5bee3872580
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Fri Jul 4 19:19:41 2014 +0200

    coverity#735691 Unchecked dynimic cast
    
    Change-Id: I5b26469792cf7b2ac6b1b28e2419cadeea09a37d

diff --git a/dbaccess/source/ui/misc/propertystorage.cxx b/dbaccess/source/ui/misc/propertystorage.cxx
index f13c3a1..3d59a5e 100644
--- a/dbaccess/source/ui/misc/propertystorage.cxx
+++ b/dbaccess/source/ui/misc/propertystorage.cxx
@@ -62,7 +62,12 @@ namespace dbaui
                 // TODO: one could throw an IllegalArgumentException here - finally, this method
                 // is (to be) used from within an XPropertySet::setPropertyValue implementation,
                 // where this would be the appropriate reaction on wrong value types
-                boost::scoped_ptr< ITEMTYPE > pClone( dynamic_cast< ITEMTYPE* >( pTypedItem->Clone() ) );
+                ITEMTYPE* pCloneItem = dynamic_cast< ITEMTYPE* >( pTypedItem->Clone() );
+                if(!pCloneItem)
+                {
+                    return false;
+                }
+                boost::scoped_ptr< ITEMTYPE > pClone( pCloneItem);
                 assert(pClone.get());
                 pClone->SetValue( aValue );
                 _rSet.Put( *pClone );


More information about the Libreoffice-commits mailing list