Tag: cws_src680_aquavcl05
User: ericb   
Date: 2008-01-29 09:09:43+0000
Modified:
   dba/connectivity/source/drivers/macab/MacabHeader.cxx

Log:
 #i83707# fix potential crash. Fixes proposed by P. Luby

File Changes:

Directory: /dba/connectivity/source/drivers/macab/
==================================================

File [changed]: MacabHeader.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/macab/MacabHeader.cxx?r1=1.2&r2=1.2.74.1
Delta lines:  +17 -11
---------------------
--- MacabHeader.cxx     2007-09-13 17:52:42+0000        1.2
+++ MacabHeader.cxx     2008-01-29 09:09:40+0000        1.2.74.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: MacabHeader.cxx,v $
  *
- *  $Revision: 1.2 $
+ *  $Revision: 1.2.74.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/09/13 17:52:42 $
+ *  last change: $Author: ericb $ $Date: 2008/01/29 09:09:40 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -52,8 +52,14 @@
 #include <com/sun/star/sdbc/DataType.hpp>
 #endif
 
+#ifndef _DBHELPER_DBCONVERSION_HXX_
+#include <connectivity/dbconversion.hxx>
+#endif
+
 using namespace connectivity::macab;
 using namespace com::sun::star::sdbc;
+using namespace com::sun::star::util;
+using namespace ::dbtools;
 
 // -------------------------------------------------------------------------
 MacabHeader::MacabHeader(const sal_Int32 _size, macabfield **_fields)
@@ -75,6 +81,7 @@
                        fields[i] = new macabfield;
                        fields[i]->type = _fields[i]->type;
                        fields[i]->value = _fields[i]->value;
+                       if (fields[i]->value)
                        CFRetain(fields[i]->value);
                }
        }
@@ -169,14 +176,13 @@
 
        if(i < size)
        {
-               if(fields[i] == NULL)
+           if(fields[i] == NULL || fields[i]->value == NULL || 
CFGetTypeID(fields[i]->value) != CFStringGetTypeID())
                        return ::rtl::OUString();
                try
                {
                        nRet = CFStringToOUString( (CFStringRef) 
fields[i]->value);
                }
                catch(...){ }
-
        }
 
        return nRet;




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to