Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEGV_ACCERR #134

Open
jezzmemo opened this issue Jul 23, 2016 · 1 comment
Open

SEGV_ACCERR #134

jezzmemo opened this issue Jul 23, 2016 · 1 comment

Comments

@jezzmemo
Copy link

1 Note 0x0006d1e3 -ENTBinaryProtocol writeString:
2 Note 0x0006d1e3 -ENTBinaryProtocol writeString:
3 Note 0x000b9e5b +ENTProtocolUtil _writeValue:forField:toProtocol:
4 Note 0x000ba5d9 +ENTProtocolUtil writeObject:ontoProtocol:
5 Note 0x000b99f3 +ENTProtocolUtil _writeValue:forField:toProtocol:
6 Note 0x000ba84d +ENTProtocolUtil sendMessage:toProtocol:withArgPairs:
7 Note 0x000965cd -EDAMNoteStoreClient createNote:note:
8 Note 0x0012f329 __48-[ENNoteStoreClient createNote:success:failure:]_block_invoke (ENNoteStoreClient.m:504)
9 Note 0x000ed5f7 __52-[ENStoreClient invokeAsyncIdBlock:success:failure:]_block_invoke (ENStoreClient.m:107)

this crash is app problem? or evernote sdk bug?

@jezzmemo
Copy link
Author

jezzmemo commented Jul 23, 2016

I find the bug,the ENTBinaryProtocol file,the method:

- (void) writeString: (NSString *) value {

  if (value != nil) {
    const char \* utf8Bytes = [value UTF8String];
    int length = (int)strlen(utf8Bytes);
    [self writeI32: length];
    [self.transport write: (uint8_t *) utf8Bytes offset: 0 length: length];
  }
  else {
    // instead of crashing when we get null, let's write out a zero
    // length string
    [self writeI32: 0];
  }
}

if the string value had some invalid characters,the utf8Bytes will point to the null,
strlen function will crash.

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

No branches or pull requests

1 participant