Skip to content

fix: replace unsafe Int32 signal cast with validated Int32(exactly:) in SandboxService kill handler#1221

Open
jay4617 wants to merge 1 commit intoapple:mainfrom
jay4617:new-issue
Open

fix: replace unsafe Int32 signal cast with validated Int32(exactly:) in SandboxService kill handler#1221
jay4617 wants to merge 1 commit intoapple:mainfrom
jay4617:new-issue

Conversation

@jay4617
Copy link

@jay4617 jay4617 commented Feb 16, 2026

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

the kill() handler in SandboxService used unsafe Int32() casts to narrow signal values received as Int64 over XPC. This could silently truncate out-of-range values, leading to incorrect signals being sent to containers or processes. This fix replaces the unsafe casts with Int32(exactly:), which validates the value fits within range and throws a descriptive .invalidArgument error otherwise, resolving the existing TODO comment on line 486

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

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