Alexander Kopachov %!s(int64=3) %!d(string=hai) anos
pai
achega
6b1afaf1c2
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      totp/types/token_info.c

+ 2 - 0
totp/types/token_info.c

@@ -27,6 +27,8 @@ bool token_info_set_secret(
     const char* base32_token_secret,
     const char* base32_token_secret,
     size_t token_secret_length,
     size_t token_secret_length,
     const uint8_t* iv) {
     const uint8_t* iv) {
+    if(token_secret_length == 0) return false;
+
     uint8_t* plain_secret = malloc(token_secret_length);
     uint8_t* plain_secret = malloc(token_secret_length);
     furi_check(plain_secret != NULL);
     furi_check(plain_secret != NULL);
     int plain_secret_length =
     int plain_secret_length =