Let's try -fanalyzer.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4431 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-08-25 20:57:55 +00:00
parent dcea08f73b
commit daeb88785d
7 changed files with 48 additions and 41 deletions

View File

@ -1050,8 +1050,8 @@ bool tf_ssb_id_bin_to_str(char* str, size_t str_size, const uint8_t* bin)
bool tf_ssb_id_str_to_bin(uint8_t* bin, const char* str)
{
const char* author_id = str && *str == '@' ? str + 1 : str;
const char* type = strstr(str, ".ed25519");
return tf_base64_decode(author_id, type - author_id, bin, crypto_box_PUBLICKEYBYTES) != 0;
const char* type = str ? strstr(str, ".ed25519") : NULL;
return author_id && type ? tf_base64_decode(author_id, type - author_id, bin, crypto_box_PUBLICKEYBYTES) != 0 : false;
}
static uint64_t _tf_ssb_callback_pre(tf_ssb_t* ssb)