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>
This commit is contained in:
João Abecasis 2012-03-27 15:26:19 +02:00 committed by Qt by Nokia
parent 5254f562b2
commit d4c8509a83

View File

@ -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;
}