Skip to content

fix: static analysis under-reports Swift value types - #28

Open
kcsiegal wants to merge 1 commit into
getsentry:mainfrom
kcsiegal:fix-swift-types-bound
Open

fix: static analysis under-reports Swift value types#28
kcsiegal wants to merge 1 commit into
getsentry:mainfrom
kcsiegal:fix-swift-types-bound

Conversation

@kcsiegal

Copy link
Copy Markdown

I noticed while using Reaper in a production app that the SDK was reporting a surprisingly large set of Swift structs and enums at runtime that the static analysis was not detecting in the app bundle.

The underlying cause is an incorrectly bounded loop in validSwiftTypesForReaper when iterating over the __swift5_types section. The section is an array of 4-byte relative pointers and the loop correctly strides by 4, but it bounds itself at swiftTypesData.length / 8, so the second half of the section is never visited. Updating numTypes to swiftTypesData.length / 4 surfaces the missing value types.

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