Explorar o código

re-use len values when reading sio/diversifier

Eric Betts hai 11 meses
pai
achega
4fba008a73
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      seader_credential.c

+ 2 - 2
seader_credential.c

@@ -71,10 +71,10 @@ static bool seader_credential_load(SeaderCredential* cred, FuriString* path, boo
         cred->credential = swapped;
 
         // Optional SIO/Diversifier
-        flipper_format_read_hex(file, "SIO", cred->sio, sizeof(cred->sio));
         cred->sio_len = sizeof(cred->sio); // No way to know real length;
-        flipper_format_read_hex(file, "Diversifier", cred->diversifier, sizeof(cred->diversifier));
         cred->diversifier_len = sizeof(cred->diversifier); // No way to know real length;
+        flipper_format_read_hex(file, "SIO", cred->sio, cred->sio_len);
+        flipper_format_read_hex(file, "Diversifier", cred->diversifier, cred->diversifier_len);
 
         parsed = true;
     } while(false);