mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #2263] d3d12_xs_surface: guard GUID negative bounds, SCARAB BOM/CRLF, and bad paths #2268
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2268
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2263
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/d3d12-xs-surface-safety📝 Commits (1)
15d9ec9d3d12_xs_surface: guard GUID negative bounds, SCARAB BOM/CRLF, and bad paths📊 Changes
2 files changed (+148 additions, -45 deletions)
View changed files
📝
tests/test_d3d12_xs_surface.py(+80 -0)📝
tools/d3d12_xs_surface.py(+68 -45)📄 Description
Claimed in the coordination issue as: D3D12-XS-SURFACE-SCARAB-CRLF-BOM-AND-GUID-BOUNDS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7190940196)
What and why
tools/d3d12_xs_surface.pyhad three validation and SCARAB parsing gaps:check_guid_values()checked upper bounds on GUID fields (> 0xFFFFFFFF,> 0xFFFF,> 0xFF) without rejecting negative components (< 0).parse_scarab_iid_table(),parse_scarab_iid_console(), andparse_scarab_catalogue()opened files with"utf-8"instead of"utf-8-sig", andparse_scarab_catalogue()stripped only"\n"instead of"\r\n".check_scarab()checkedos.path.exists(...)rather than directory/regular-file validity and letOSError/UnicodeDecodeError/ValueErrorcrash unhandled, whilemain()usedif args.scarab:so--scarab ""silently skipped checking and returned 0.This updates the bounds checks, opens SCARAB inputs with
utf-8-sigandrstrip("\r\n"), reports invalid/unreadable SCARAB paths aserrorsentries, checksargs.scarab is not None, and adds unit/CLI tests for these cases.Tested
python -I tests/test_d3d12_xs_surface.pypython -I tools/d3d12_xs_surface.py --checkupstream/mainbaseline negative control: failed with the new tests before the fixpython -I tests/test_ci_registration.py,python -I tests/test_text_write_line_endings.py,python -I scripts/check_no_game_data.py,python -I -m compileall -q, andgit diff --cached --checkGPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.