Skip to content

Added safety checks to fishhook.c - #62

Closed
chrisspankroy wants to merge 2 commits into
facebook:masterfrom
chrisspankroy:master
Closed

chrisspankroy wants to merge 2 commits into
facebook:masterfrom
chrisspankroy:master

Conversation

@chrisspankroy

Copy link
Copy Markdown

Fixes a crash that would occur on devices running iOS 13. fishhook.c would access bad memory, this adds safety checks to the offending line. This fixes #61

@daybreak1024

Copy link
Copy Markdown

Hello, I am experiencing the same problem.

I Use this program,but hook would be invalid.

Why indirect_symbol_bindings would out of bounds? Can you give me some prompt or inspiration.

And thanks.

dyy1993 pushed a commit to dyy1993/react-native that referenced this pull request Aug 28, 2019
@PotatoMapper

Copy link
Copy Markdown

Pulled and Testing on a 13 Beta device I had available and PR works well and as designed 👌

@dinhvh

dinhvh commented Sep 11, 2019

Copy link
Copy Markdown

Any idea of the condition under which it happens?

@megCanicalKb

Copy link
Copy Markdown
Contributor

Have you tested this locally to verify that the symbols were still rebinded?

indirect_symbol_bindings is a void** so sizeof() will return 8 bytes on arm64, then indirect_symbol_bindings[0] has the same size which means the line is simplified:

if (i < (8 / 8)) { ... }

I am not sure what check you are trying to add but I don't think that's the right code for it. You might have been hoping that sizeof(ptr) returns the total size of the array, but this only works for statically allocated arrays, with a size known by the compiler at compile time (here it's not).

@jobsyu jobsyu mentioned this pull request Jun 18, 2020
@hy89757 hy89757 mentioned this pull request Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fishhook crash on iOS 13.0 beta

6 participants