Skip to content

fix(fspy): handle null ObjectName and Buffer in UNICODE_STRING on Windows#91

Merged
branchseer merged 12 commits intomainfrom
fix-null-object-name-crash
Jan 11, 2026
Merged

fix(fspy): handle null ObjectName and Buffer in UNICODE_STRING on Windows#91
branchseer merged 12 commits intomainfrom
fix-null-object-name-crash

Conversation

@branchseer
Copy link
Copy Markdown
Member

Summary

  • Fix crash when running oxlint with --type-aware flag on Windows
  • The crash occurred in fspy_preload_windows at winapi_utils.rs:33 due to null pointer in slice::from_raw_parts
  • Root cause: ObjectName or its Buffer field in UNICODE_STRING can be null when tsgolint is spawned

Changes

  • convert.rs: Check for null ObjectName before dereferencing
  • winapi_utils.rs: Handle null/empty Buffer by returning empty slice, fix Length interpretation (bytes, not u16 count)
  • Added oxlint_type_aware test to verify the fix
  • Added oxlint-tsgolint to test_bins for the test

Test plan

  • cargo test -p fspy oxlint_type_aware passes
  • Test verifies that --type-aware flag works without crashing

🤖 Generated with Claude Code

@branchseer branchseer force-pushed the fix-null-object-name-crash branch from 2b56641 to b07acfd Compare January 11, 2026 10:05
branchseer and others added 2 commits January 11, 2026 04:43
Add hook for NtQueryDirectoryFileEx (newer Windows API) to properly track
READ_DIR accesses. This fixes the oxlint_reads_directory test which uses
the newer API not covered by NtQueryDirectoryFile.

- Add ntdll.dll lookup support for dynamic symbols in DetourAny::attach
- Define NtQueryDirectoryFileEx function type (not in ntapi crate)
- Use Detour::dynamic for runtime symbol resolution
- Update readdir test to use tempdir with cross-platform explanation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@branchseer branchseer merged commit 14167c2 into main Jan 11, 2026
6 checks passed
@branchseer branchseer deleted the fix-null-object-name-crash branch January 11, 2026 14:28
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.

2 participants