src/corelib/kernel/qvariant.cpp
branchRCL_3
changeset 8 3f74d0d4af4c
parent 4 3b1da2848fc7
child 30 5dc02b23752f
--- a/src/corelib/kernel/qvariant.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/src/corelib/kernel/qvariant.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -466,9 +466,13 @@
      * QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include
      * user defined pointer types. */
     const char *const typeName = QMetaType::typeName(a->type);
-    if (typeName[qstrlen(typeName) - 1] == '*')
+    uint typeNameLen = qstrlen(typeName);
+    if (typeNameLen > 0 && typeName[typeNameLen - 1] == '*')
         return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr);
 
+    if (a->is_null && b->is_null)
+        return true;
+
     return a_ptr == b_ptr;
 }