summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-12-05 19:29:07 +0100
committerMathias Bauer <mba@openoffice.org>2009-12-05 19:29:07 +0100
commit342e37f151084dfb8f840c0cfaa4674dcf880267 (patch)
tree2dea2ded6ba96ae62da1d9dd7faeb9a80ca7065a /tools
parent549fb21f357eaa2cda1a53d4fa84cf87896aed6d (diff)
parent2f883652c1af80075dc68b5cb439a13cd1dc4129 (diff)
merge to m67
Diffstat (limited to 'tools')
-rw-r--r--tools/source/memtools/table.cxx41
1 files changed, 26 insertions, 15 deletions
diff --git a/tools/source/memtools/table.cxx b/tools/source/memtools/table.cxx
index ba0dbb8a90f9..75aafddb6c58 100644
--- a/tools/source/memtools/table.cxx
+++ b/tools/source/memtools/table.cxx
@@ -125,26 +125,37 @@ BOOL Table::Insert( ULONG nKey, void* p )
{
USHORT n = 0;
USHORT nTempCount = (USHORT)nCount * 2;
- void** pNodes = Container::ImpGetOnlyNodes();
- ULONG nCompareKey = (ULONG)(*pNodes);
- while ( nKey > nCompareKey )
+ //<!--Modified by PengYunQuan for resolving a NULL pointer access
+
+ if( void** pNodes = Container::ImpGetOnlyNodes() )
{
- n += 2;
- pNodes += 2;
- if ( n < nTempCount )
- nCompareKey = (ULONG)(*pNodes);
- else
+ ULONG nCompareKey = (ULONG)(*pNodes);
+ while ( nKey > nCompareKey )
{
- nCompareKey = 0;
- break;
+ n += 2;
+ pNodes += 2;
+ if ( n < nTempCount )
+ nCompareKey = (ULONG)(*pNodes);
+ else
+ {
+ nCompareKey = 0;
+ break;
+ }
}
- }
- // Testen, ob sich der Key schon in der Tabelle befindet
- if ( nKey == nCompareKey )
- return FALSE;
+ // Testen, ob sich der Key schon in der Tabelle befindet
+ if ( nKey == nCompareKey )
+ return FALSE;
- i = n;
+ i = n;
+ }
+ else
+ {
+ i = 0;
+ if ( ImplGetIndex( nKey, &i ) != TABLE_ENTRY_NOTFOUND )
+ return FALSE;
+ }
+ //-->Modified by PengYunQuan for resolving a NULL pointer access
}
else
{