diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-03-27 15:26:19 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-28 00:44:30 +0200 |
commit | d4c8509a8379e65edcb2854ce7c527ed048e2ab1 (patch) | |
tree | ee610af871abbc6668072295ef253e6bef0d715f /src/corelib/kernel/qtranslator.cpp | |
parent | 5254f562b24e31d32c98ec72f7cfd33f7a7df136 (diff) |
Fail when no translations found, reset pointers on failure
We don't want to be using or trusting partial loads.
Change-Id: I3934d6cf54cd99eaab2fa7aee9a0e9968d9f3c13
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qtranslator.cpp')
-rw-r--r-- | src/corelib/kernel/qtranslator.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 5ecaa280b3..02cd85f533 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -713,6 +713,20 @@ bool QTranslatorPrivate::do_load(const uchar *data, int len) data += blockLen; } + if (!offsetArray || !messageArray) + ok = false; + + if (!ok) { + messageArray = 0; + contextArray = 0; + offsetArray = 0; + numerusRulesArray = 0; + messageLength = 0; + contextLength = 0; + offsetLength = 0; + numerusRulesLength = 0; + } + return ok; } |