Skip to content

Commit

Permalink
Make sure thread_identifier_info_t is valid before dereferencing.
Browse files Browse the repository at this point in the history
  • Loading branch information
kstenerud committed Apr 3, 2017
1 parent 30b5f48 commit e8977a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/KSCrash/Recording/Tools/KSThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ bool ksthread_getQueueName(const KSThread thread, char* const buffer, int bufLen
}

thread_identifier_info_t idInfo = (thread_identifier_info_t)info;
if(ksmem_isMemoryReadable(idInfo, sizeof(*idInfo)))
{
KSLOG_DEBUG("Thread %p has an invalid thread identifier info %p", thread, idInfo);
return false;
}
dispatch_queue_t* dispatch_queue_ptr = (dispatch_queue_t*)idInfo->dispatch_qaddr;
if(!ksmem_isMemoryReadable(dispatch_queue_ptr, sizeof(*dispatch_queue_ptr)))
{
Expand Down

2 comments on commit e8977a4

@leeeGreat
Copy link

@leeeGreat leeeGreat commented on e8977a4 Dec 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2018-12-30 2 59 16

hi man this issue is also exist,I have no idea how to fix it,because I can not repro it,can you help me

@leeeGreat
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is my react-native-sentry version,"react-native-sentry": "0.38.2",
in SentryReactNative.podspec file I find KSCrash version
s.dependency 'Sentry/KSCrash', '~> 3.12.4'
sentry on line have lots of this crash,I need your help

Please sign in to comment.