src/corelib/kernel/qvariant.cpp
changeset 7 f7bc934e204c
parent 0 1918ee327afb
--- a/src/corelib/kernel/qvariant.cpp	Tue Feb 02 00:43:10 2010 +0200
+++ b/src/corelib/kernel/qvariant.cpp	Wed Mar 31 11:06:36 2010 +0300
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -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;
 }