XGameUI: maxTextLength=0 does not apply the 1024-character default #248

Open
opened 2026-11-26 03:39:11 +00:00 by github-bot · 0 comments
Owner

@⁠Bennet0k on GitHub · 2026-11-24 22:59 UTC · original

Source

The GDK documentation defines maxTextLength=0 as a limit of 1024. The current limit helper returns all 1025 characters for a 1025-ASCII-character input with that argument. Reproduced by executing the Rust helper from 2119b0e. The dialog itself was not exercised in this check.

Proposed fix. Normalize zero to 1024 at entry and pass the effective limit to both the input control and result trimming. Add tests for zero and an explicit positive limit.

Found in an AI-assisted audit of 2119b0e.

**@⁠Bennet0k** on GitHub · 2026-11-24 22:59 UTC · [original](https://github.com/fxceless/victory-fork/issues/248) [Source](https://github.com/fxceless/victory-fork/blob/2119b0e44c53aa9648307b0c5c73590290305b1f/crates/victory-hle/src/modules/xgameui.rs#L54-L111) The [GDK documentation](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/xgameui/functions/xgameuishowtextentryasync?view=gdk-2604) defines `maxTextLength=0` as a limit of 1024. The current limit helper returns all 1025 characters for a 1025-ASCII-character input with that argument. Reproduced by executing the Rust helper from `2119b0e`. The dialog itself was not exercised in this check. **Proposed fix.** Normalize zero to 1024 at entry and pass the effective limit to both the input control and result trimming. Add tests for zero and an explicit positive limit. Found in an AI-assisted audit of `2119b0e`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:11 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/fxceless--victory-fork#248
No description provided.