src/corelib/kernel/qvariant.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 30 5dc02b23752f
--- a/src/corelib/kernel/qvariant.cpp	Fri Apr 16 15:50:13 2010 +0300
+++ b/src/corelib/kernel/qvariant.cpp	Mon May 03 13:17:34 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;
 }