mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Fix segfault when aesgcm url isn't the expected size
Fixes the bug mentioned in https://github.com/profanity-im/profanity/issues/1478#issuecomment-794161606 The rest of https://github.com/profanity-im/profanity/issues/1478 I can't reproduce. Seems to work fine.
This commit is contained in:
parent
f30a9e1256
commit
a46c4443e3
@ -1862,6 +1862,7 @@ omemo_parse_aesgcm_url(const char* aesgcm_url,
|
||||
}
|
||||
|
||||
if (strlen(*fragment) != AESGCM_URL_NONCE_LEN + AESGCM_URL_KEY_LEN) {
|
||||
ret = 1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,7 @@ aesgcm_file_get(void* userdata)
|
||||
// Convert the aesgcm:// URL to a https:// URL and extract the encoded key
|
||||
// and tag stored in the URL fragment.
|
||||
if (omemo_parse_aesgcm_url(aesgcm_dl->url, &https_url, &fragment) != 0) {
|
||||
cons_show_error("Download failed: Cannot parse URL '%s'.", aesgcm_dl->url);
|
||||
http_print_transfer_update(aesgcm_dl->window, aesgcm_dl->url,
|
||||
"Download failed: Cannot parse URL '%s'.",
|
||||
aesgcm_dl->url);
|
||||
|
Loading…
Reference in New Issue
Block a user