-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix nfc_protocol_support_scene_save_name_on_event crash #3418
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @xMasterX , thanks for PR!
The problem behind this issue is in nfc_protocol_support_scene_save_name_on_event()
function. We assume that we come to this scene after reading and get protocol from list of detected protocols, however we may come to this scene from "Add manually". If MfClassic protocol was detected before, it leads to call of nfc_scene_save_name_on_event_mf_classic()
function and flipper crashes on nfc_get_data()
call with incorrect protocol.
Your fix works because there is no "save_name_*()" functions for Iso14443a protocols. However it may lead to another issues if we implement these function in future.
The correct fix is to get protocol from nfc_device in nfc_protocol_support_scene_save_name_on_event()
function. Please, consider the patch with these fixes and if everything is OK, apply it and we will merge your PR.
fix_save_name.txt
Hi, For some reason part of the functions in And yes if About your patch and Not clearing the array at |
I just didn't like setting array of detected protocol to NfcProtocolIso14443_3a explicitly from start scene. What if we change value of NfcProtocolIso14443_3a to another value by just changing order in enumeration. The correct way to deal with detected protocols is to make a private class with getters and setters. And this class will correctly reset it state internally. Thanks for noticing that. I think we should merge this PR for now, since it fixes the issue, and we will refactor working with detected protocol in future. |
What's new
protocols_detected
list being used inAdd manually
Scene (in save_name -> on event call) after reading mifare classic tag and going to add manually with selecting other protocolVerification
Checklist (For Reviewer)