Skip to content

winrl: validate coordinates and message window access#95

Closed
j-lojek wants to merge 1 commit intoNetHack-LE:mainfrom
j-lojek:fix/pr6-winrl-index-and-message-guards
Closed

winrl: validate coordinates and message window access#95
j-lojek wants to merge 1 commit intoNetHack-LE:mainfrom
j-lojek:fix/pr6-winrl-index-and-message-guards

Conversation

@j-lojek
Copy link

@j-lojek j-lojek commented Feb 20, 2026

Summary

  • add try_screen_offset() helper to validate x,y before converting to size_t map offsets
  • remove modulo-based indexing in RL screen writers and early-return on out-of-range coordinates
  • guard in_yn_function message extraction against missing/empty message windows
  • ensure copied message buffers are explicitly NUL-terminated

Bugs fixed

  • S4: signed-to-size_t index path in RL screen writers
  • S5: unsafe .back() on potentially empty win->strings

Validation

  • code-level validation and patch review of all affected call paths
  • full target build is currently blocked on GCC15 compatibility issue tracked in PR 10

@j-lojek j-lojek closed this Feb 20, 2026
@j-lojek j-lojek deleted the fix/pr6-winrl-index-and-message-guards branch February 20, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant