[Libreoffice-commits] .: rsc/source

Michael Meeks mmeeks at kemper.freedesktop.org
Mon Jan 31 12:42:00 PST 2011


 rsc/source/parser/rscdb.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 229282ceaaf975cc4d41d79fd48fb946ecef0e39
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Mon Jan 31 20:41:37 2011 +0000

    fix branching on un-initialized memory in some cases

diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index 6c4ec25..ee4a7e1 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -369,8 +369,9 @@ void RscTypCont :: Delete( Atom nRT, const RscId & rId ){
 sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName,
                                  sal_uInt32 nConst, sal_uInt32 nId, BOOL bFirst )
 {
-    RscSysEntry *	pSysEntry;
-    BOOL			bId1 = FALSE;
+    RscSysEntry *pSysEntry;
+    RscSysEntry *pFoundEntry = NULL;
+    BOOL		 bId1 = FALSE;
 
     for ( size_t i = 0, n = aSysLst.size(); i < n; ++i )
     {
@@ -381,9 +382,12 @@ sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName,
             if(  pSysEntry->nRscTyp == nRscTyp
               && pSysEntry->nTyp    == nConst
               && pSysEntry->nRefId  == nId
-              )
+                 ) {
+                pFoundEntry = pSysEntry;
                 break;
+            }
     }
+    pSysEntry = pFoundEntry;
 
     if ( !pSysEntry || (bFirst && !bId1) )
     {


More information about the Libreoffice-commits mailing list