[PR #1268] find_hash_lookup: clamp raw section sizes and validate window and top parameters (OLD-9792) #1302

Open
opened 2026-11-26 20:20:47 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1268
Author: @wetw0rks-c0ding
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: feat/find-hash-lookup-bounds


📝 Commits (1)

  • ac2c3d3 find_hash_lookup: clamp raw section sizes and validate window and top parameters

📊 Changes

2 files changed (+86 additions, -1 deletions)

View changed files

📝 tests/test_find_hash_lookup.py (+77 -0)
📝 tools/find_hash_lookup.py (+9 -1)

📄 Description

Claimed in the coordination issue as: OLD-9792

What and why

tools/find_hash_lookup.py trusted raw section sizes and unchecked window/top parameters, so malformed inputs could drive an out-of-range read. It now clamps the sizes and validates the parameters, with regression tests.

Tested

  • python3 -I tests/test_find_hash_lookup.py -> Ran 12 tests, OK (exit 0)
  • python -I scripts/check_no_game_data.py tools/find_hash_lookup.py tests/test_find_hash_lookup.py -> clean (exit 0)
  • Environment: Linux (CachyOS), CPU-only tests, no GPU required

AI-assisted: Yes. This work was done with OpenCode agents.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1268 **Author:** [@wetw0rks-c0ding](https://github.com/wetw0rks-c0ding) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/find-hash-lookup-bounds` --- ### 📝 Commits (1) - [`ac2c3d3`](https://github.com/ubiquitarianism/leonida/commit/ac2c3d335e972380895d2391977fa02cff254852) find_hash_lookup: clamp raw section sizes and validate window and top parameters ### 📊 Changes **2 files changed** (+86 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_find_hash_lookup.py` (+77 -0) 📝 `tools/find_hash_lookup.py` (+9 -1) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9792 ### What and why `tools/find_hash_lookup.py` trusted raw section sizes and unchecked window/top parameters, so malformed inputs could drive an out-of-range read. It now clamps the sizes and validates the parameters, with regression tests. ### Tested - `python3 -I tests/test_find_hash_lookup.py` -> Ran 12 tests, OK (exit 0) - `python -I scripts/check_no_game_data.py tools/find_hash_lookup.py tests/test_find_hash_lookup.py` -> clean (exit 0) - Environment: Linux (CachyOS), CPU-only tests, no GPU required AI-assisted: Yes. This work was done with OpenCode agents. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#1302
No description provided.