Skip to content

fix: hardening — NULL check, max_inode bound, stopAccessing leak - #1

Open
kaffeindecaf wants to merge 1 commit into
forcequitOS:mainfrom
kaffeindecaf:main
Open

fix: hardening — NULL check, max_inode bound, stopAccessing leak#1
kaffeindecaf wants to merge 1 commit into
forcequitOS:mainfrom
kaffeindecaf:main

Conversation

@kaffeindecaf

Copy link
Copy Markdown

Summary

3 hardening fixes from W0lfSword deep audit.

Changes

  • bad_query.c:150 — Add NULL guard on path parameter in bad_query_list() (prevent crash)
  • bad_query.c:150 — Clamp max_inode to UINT32_MAX to prevent infinite loop if caller passes INT64_MAX
  • ContentView.swift:111 — Add stopAccessingSecurityScopedResource() via defer (was leaking kernel security-scoped resource handle)

Testing

  • Compiles with Xcode
  • bad_query_list(NULL, 0) returns NULL instead of crashing
  • bad_query_list(path, INT64_MAX) does not hang

- bad_query_list: add NULL path check and clamp max_inode to UINT32_MAX
- ContentView.swift: add stopAccessingSecurityScopedResource via defer
  (was leaking kernel security-scoped resource)
@forcequitOS

Copy link
Copy Markdown
Owner

Some of these will likely be resolved in a future revision (without 100% vibe-reviewing the code to find things I should fix), thanks I guess, though.
I'll close this PR when I get around to updating this repo

@fqhlxw520

Copy link
Copy Markdown

@forcequitOS I have compile this source and run success. Is there any chance not ask open develp mode?

@kaffeindecaf

Copy link
Copy Markdown
Author

Some of these will likely be resolved in a future revision (without 100% vibe-reviewing the code to find things I should fix), thanks I guess, though.

I'll close this PR when I get around to updating this repo

Alright!(sorry for sloppifying everything with deepseek i didnt even know it made a PR😭😭)

@sousicky

Copy link
Copy Markdown

hi

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.

4 participants