diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-07-30 09:55:46 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-30 11:55:49 (GMT) |
commit | 3bbe09626077576299df790db329bdd5c51be7fe (patch) | |
tree | e294f82e3b7bf5804969a93ddcf47fd9c32a2ec7 /src/corelib/plugin | |
parent | 4baa7d173d88bb1bc2bed51880ef9b0b1bb831a4 (diff) | |
download | Qt-3bbe09626077576299df790db329bdd5c51be7fe.zip Qt-3bbe09626077576299df790db329bdd5c51be7fe.tar.gz Qt-3bbe09626077576299df790db329bdd5c51be7fe.tar.bz2 |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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; |