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

Open
opened 2026-11-24 22:59:57 +00:00 by Bennet0k · 0 comments
Bennet0k commented 2026-11-24 22:59:57 +00:00 (Migrated from github.com)
Contributor

Imported from fxceless/victory-fork. Originally posted by Bennet0k on 2026-11-24T22:59:57Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593126182 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/248). Originally posted by [Bennet0k](https://github.com/Bennet0k) on 2026-11-24T22:59:57Z. --- [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`.
Sign in to join this conversation.
No labels
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.

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