mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 593296 - avoid potential read beyond end of kern-pair list. r=jfkthame a=blocking-beta7+
This commit is contained in:
parent
4fbb745b8c
commit
a4541c4944
@ -284,6 +284,7 @@ GetKernValueFmt0(const void* aSubtable,
|
||||
|
||||
const KernPair *lo = reinterpret_cast<const KernPair*>(hdr + 1);
|
||||
const KernPair *hi = lo + PRUint16(hdr->nPairs);
|
||||
const KernPair *limit = hi;
|
||||
|
||||
if (reinterpret_cast<const char*>(aSubtable) + aSubtableLen <
|
||||
reinterpret_cast<const char*>(hi)) {
|
||||
@ -304,7 +305,7 @@ GetKernValueFmt0(const void* aSubtable,
|
||||
}
|
||||
}
|
||||
|
||||
if (KERN_PAIR_KEY(lo->left, lo->right) == key) {
|
||||
if (lo < limit && KERN_PAIR_KEY(lo->left, lo->right) == key) {
|
||||
if (aIsOverride) {
|
||||
aValue = PRInt16(lo->value);
|
||||
} else if (aIsMinimum) {
|
||||
|
Loading…
Reference in New Issue
Block a user