You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by pe...@apache.org on 2001/07/19 20:43:18 UTC
cvs commit: xml-xerces/c/src/util RefHash2KeysTableOf.c RefHash3KeysIdPool.c RefHashTableOf.c
peiyongz 01/07/19 11:43:18
Modified: c/src/util RefHash2KeysTableOf.c RefHash3KeysIdPool.c
RefHashTableOf.c
Log:
fix: detect null poiniter in enumerator's ctor.
Revision Changes Path
1.5 +7 -0 xml-xerces/c/src/util/RefHash2KeysTableOf.c
Index: RefHash2KeysTableOf.c
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/util/RefHash2KeysTableOf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RefHash2KeysTableOf.c 2001/06/04 13:45:03 1.4
+++ RefHash2KeysTableOf.c 2001/07/19 18:43:18 1.5
@@ -56,6 +56,9 @@
/**
* $Log: RefHash2KeysTableOf.c,v $
+ * Revision 1.5 2001/07/19 18:43:18 peiyongz
+ * fix: detect null poiniter in enumerator's ctor.
+ *
* Revision 1.4 2001/06/04 13:45:03 tng
* The "hash" argument clashes with STL hash. Fixed by Pei Yong Zhang.
*
@@ -78,6 +81,7 @@
#include <util/RefHash2KeysTableOf.hpp>
#endif
+#include <util/NullPointerException.hpp>
// ---------------------------------------------------------------------------
// RefHash2KeysTableOf: Constructors and Destructor
@@ -345,6 +349,9 @@
RefHash2KeysTableOfEnumerator(RefHash2KeysTableOf<TVal>* const toEnum, const bool adopt)
: fAdopted(adopt), fCurElem(0), fCurHash((unsigned int)-1), fToEnum(toEnum)
{
+ if (!toEnum)
+ ThrowXML(NullPointerException, XMLExcepts::CPtr_PointerIsZero);
+
//
// Find the next available bucket element in the hash table. If it
// comes back zero, that just means the table is empty.
1.4 +7 -0 xml-xerces/c/src/util/RefHash3KeysIdPool.c
Index: RefHash3KeysIdPool.c
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/util/RefHash3KeysIdPool.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RefHash3KeysIdPool.c 2001/06/04 13:45:04 1.3
+++ RefHash3KeysIdPool.c 2001/07/19 18:43:18 1.4
@@ -56,6 +56,9 @@
/**
* $Log: RefHash3KeysIdPool.c,v $
+ * Revision 1.4 2001/07/19 18:43:18 peiyongz
+ * fix: detect null poiniter in enumerator's ctor.
+ *
* Revision 1.3 2001/06/04 13:45:04 tng
* The "hash" argument clashes with STL hash. Fixed by Pei Yong Zhang.
*
@@ -75,6 +78,7 @@
#include <util/RefHash3KeysIdPool.hpp>
#endif
+#include <util/NullPointerException.hpp>
// ---------------------------------------------------------------------------
// RefHash3KeysIdPool: Constructors and Destructor
@@ -388,6 +392,9 @@
RefHash3KeysIdPoolEnumerator(RefHash3KeysIdPool<TVal>* const toEnum, const bool adopt)
: fAdoptedElems(adopt), fCurIndex(0), fToEnum(toEnum)
{
+ if (!toEnum)
+ ThrowXML(NullPointerException, XMLExcepts::CPtr_PointerIsZero);
+
//
// Find the next available bucket element in the pool. We use the id
// array since its very easy to enumerator through by just maintaining
1.9 +7 -0 xml-xerces/c/src/util/RefHashTableOf.c
Index: RefHashTableOf.c
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/util/RefHashTableOf.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- RefHashTableOf.c 2001/06/04 13:45:04 1.8
+++ RefHashTableOf.c 2001/07/19 18:43:18 1.9
@@ -56,6 +56,9 @@
/**
* $Log: RefHashTableOf.c,v $
+ * Revision 1.9 2001/07/19 18:43:18 peiyongz
+ * fix: detect null poiniter in enumerator's ctor.
+ *
* Revision 1.8 2001/06/04 13:45:04 tng
* The "hash" argument clashes with STL hash. Fixed by Pei Yong Zhang.
*
@@ -100,6 +103,7 @@
#include <util/RefHashTableOf.hpp>
#endif
+#include <util/NullPointerException.hpp>
// ---------------------------------------------------------------------------
// RefHashTableOf: Constructors and Destructor
@@ -366,6 +370,9 @@
RefHashTableOfEnumerator(RefHashTableOf<TVal>* const toEnum, const bool adopt)
: fAdopted(adopt), fCurElem(0), fCurHash((unsigned int)-1), fToEnum(toEnum)
{
+ if (!toEnum)
+ ThrowXML(NullPointerException, XMLExcepts::CPtr_PointerIsZero);
+
//
// Find the next available bucket element in the hash table. If it
// comes back zero, that just means the table is empty.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org