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

YapDatabaseCloudKit: Cast issue in hashRecordID:databaseIdentifier: #345

Closed
vzarubanov opened this issue Jul 7, 2016 · 1 comment
Closed

Comments

@vzarubanov
Copy link

vzarubanov commented Jul 7, 2016

I'm trying to sync data with publicCloudDatabase.

YapDatabase (2.9.1)
YapDatabaseCloudKit -> YapDatabaseCloudKitTransaction.m -> line 1069

memcpy(buffer, (void *)'_', 1); cause EXC_BAD_ACCESS crash. I am not sure that casting char to void* makes sense.

Solution 1: I've changed '_' to "_" and now char* to void* casting seems working.
memcpy(buffer, (void *)"_", 1);

Solution 2: char underscore = '_';
memcpy(buffer, (void *)(&underscore), 1);

For both solutions sync works well. But I'm not sure which one was supposed to be here.

Please take a look on that.
Thanks.

@robbiehanson
Copy link
Contributor

Good catch. And thanks for the solutions.

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

2 participants