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

Crashes during "Create Tag" operation (solution included) #24

Open
ytmytm opened this issue Apr 11, 2021 · 0 comments
Open

Crashes during "Create Tag" operation (solution included) #24

ytmytm opened this issue Apr 11, 2021 · 0 comments

Comments

@ytmytm
Copy link

ytmytm commented Apr 11, 2021

It's too simple for a PR, just three different lines.

I get "Fatal exception 9(LoadStoreAlignmentCause):" error whenever trying to use Create Tag option.
The reason seems to be a bug inside sscanf - an unaligned memory access somewhere within sscanf function used here:

sscanf((const char *)(idStr) + (count * 2), "%2hhx", &createNFCID[count]);

The solution to this is to use a one-byte buffer for the target value, that gets copied into proper place inside createNFCID

          uint8_t idbuf;
          sscanf((const char *)(idStr) + (count * 2), "%2hhx", &idbuf);
          createNFCID[count] = idbuf;
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