[Libreoffice-commits] core.git: 2 commits - xmlhelp/source
Caolán McNamara
caolanm at redhat.com
Thu Oct 24 08:33:34 PDT 2013
xmlhelp/source/cxxhelp/provider/databases.cxx | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
New commits:
commit b7efab3a9841a9f01c5da07db870a22866b65b04
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 24 16:20:08 2013 +0100
valgrind: on success aHDFData is out of scope
and pData points to data belonging to it
Change-Id: I2a3c1f73e4cdcb07d21ef14cb410d351f39cdba8
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index d9cd7ae..1b252f5 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -751,12 +751,12 @@ void KeywordInfo::KeywordElement::init( Databases *pDatabases,helpdatafileproxy:
listId[i] = id[i];
listAnchor[i] = anchor[i];
+ helpdatafileproxy::HDFData aHDFData;
const sal_Char* pData = NULL;
if( pHdf )
{
OString idi( id[i].getStr(),id[i].getLength(),RTL_TEXTENCODING_UTF8 );
- helpdatafileproxy::HDFData aHDFData;
bool bSuccess = pHdf->getValueForKey( idi, aHDFData );
if( bSuccess )
pData = aHDFData.getData();
commit d94f3a68f77de906abd576c7e2f31e0a8586d154
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 24 16:18:41 2013 +0100
pEmpty is completely insane to use
DbtToStringConverter protects against a NULL pointer, but not a
pointer to the too short data that pEmpty provides
Change-Id: I5d21e852ce0373eff7d3627e266b9cbc77f5dd09
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index dd97078..d9cd7ae 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -746,15 +746,13 @@ void KeywordInfo::KeywordElement::init( Databases *pDatabases,helpdatafileproxy:
listAnchor.realloc( id.size() );
listTitle.realloc( id.size() );
- const sal_Char* pData = NULL;
- const sal_Char pEmpty[] = "";
-
for( sal_uInt32 i = 0; i < id.size(); ++i )
{
listId[i] = id[i];
listAnchor[i] = anchor[i];
- pData = pEmpty;
+ const sal_Char* pData = NULL;
+
if( pHdf )
{
OString idi( id[i].getStr(),id[i].getLength(),RTL_TEXTENCODING_UTF8 );
More information about the Libreoffice-commits
mailing list