From 3bbe09626077576299df790db329bdd5c51be7fe Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 30 Jul 2012 11:55:46 +0200 Subject: Check for 0 before accessing the pointer Fixes some reported crashes where we get into qt_tokenize() with a 0 pointer. Not relevant for Qt 5, as qt_tokenize() doesn't exist there. Task-number: QTBUG-26247 Change-Id: I1cc5c5b514c1c35dfee318ad4d37a54deffc5d53 Reviewed-by: Thiago Macieira --- src/corelib/plugin/qlibrary.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 185ba74..7e691bd 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -198,6 +198,9 @@ struct qt_token_info static int qt_tokenize(const char *s, ulong s_len, ulong *advance, qt_token_info &token_info) { + if (!s) + return -1; + ulong pos = 0, field = 0, fieldlen = 0; char current; int ret = -1; -- cgit v0.12