[PR #16894] AtlasEngine: Fix a OOB read when rendering PUA chars #31036

Open
opened 2026-01-31 09:44:42 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/16894

State: closed
Merged: Yes


When no soft fonts are set up but we're asked to draw a U+EF20, etc.,
character we'll currently read out-of-bounds, because we don't check
whether the soft fonts array is non-empty. This PR fixes the issue by
first getting a slice of the data and then checking if it's ok to use.

This changeset additionally fixes a couple constinit vs. constexpr
cases. I changed them to constinit at some point because I thought
that it's more constexpr than constexpr by guaranteeing initialization
at compile time. But nope, constinit is actually weaker in a way,
because while it does guarantee that, it doesn't actually make the
data constant. In other words, constinit is not .rdata.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/16894 **State:** closed **Merged:** Yes --- When no soft fonts are set up but we're asked to draw a U+EF20, etc., character we'll currently read out-of-bounds, because we don't check whether the soft fonts array is non-empty. This PR fixes the issue by first getting a slice of the data and then checking if it's ok to use. This changeset additionally fixes a couple constinit vs. constexpr cases. I changed them to constinit at some point because I thought that it's more constexpr than constexpr by guaranteeing initialization at compile time. But nope, constinit is actually weaker in a way, because while it does guarantee that, it doesn't actually make the data constant. In other words, constinit is not `.rdata`.
claunia added the pull-request label 2026-01-31 09:44:42 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31036