diff -r 41300fa6a67c -r f7bc934e204c src/corelib/kernel/qvariant.cpp --- 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(a_ptr) == *static_cast(b_ptr); + if (a->is_null && b->is_null) + return true; + return a_ptr == b_ptr; }