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:
parent
5254f562b2
commit
d4c8509a83
@ -713,6 +713,20 @@ bool QTranslatorPrivate::do_load(const uchar *data, int len)
|
|||||||
data += blockLen;
|
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;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user