Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libxml] Limit how far we skip when looking back #5012

Open
wants to merge 2 commits into
base: 25.lts.1+
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions third_party/harfbuzz-ng/METADATA
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ third_party {
type: "UpstreamSubdir"
value: "third_party/harfbuzz-ng"
}
security {
mitigated_security_patch: "CVE-2023-25193"
}
}
7 changes: 7 additions & 0 deletions third_party/harfbuzz-ng/src/src/hb-ot-layout-gsubgpos.hh
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,13 @@ struct hb_ot_apply_context_t :
unsigned stop = num_items - 1;
if (c->buffer->flags & HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT)
stop = 1 - 1;

/* When looking back, limit how far we search; this function is mostly
* used for looking back for base glyphs when attaching marks. If we
* don't limit, we can get O(n^2) behavior where n is the number of
* consecutive marks. */
stop = (unsigned) hb_max ((int) stop, (int) idx - HB_MAX_CONTEXT_LENGTH);

while (idx > stop)
{
idx--;
Expand Down
Loading