mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Fix a segfault when uploading or downloading files
The variable `ccount->tls_policy` was not null-tested before `strcmp`.
This commit is contained in:
parent
cef0c5e927
commit
f11ad16714
@ -128,7 +128,7 @@ http_file_get(void* userdata)
|
||||
char* cert_path = prefs_get_string(PREF_TLS_CERTPATH);
|
||||
gchar* cafile = cafile_get_name();
|
||||
ProfAccount* account = accounts_get_account(session_get_account_name());
|
||||
gboolean insecure = strcmp(account->tls_policy, "trust") == 0;
|
||||
gboolean insecure = account->tls_policy && strcmp(account->tls_policy, "trust") == 0;
|
||||
account_free(account);
|
||||
pthread_mutex_unlock(&lock);
|
||||
|
||||
|
@ -187,7 +187,7 @@ http_file_put(void* userdata)
|
||||
char* cert_path = prefs_get_string(PREF_TLS_CERTPATH);
|
||||
gchar* cafile = cafile_get_name();
|
||||
ProfAccount* account = accounts_get_account(session_get_account_name());
|
||||
gboolean insecure = strcmp(account->tls_policy, "trust") == 0;
|
||||
gboolean insecure = account->tls_policy && strcmp(account->tls_policy, "trust") == 0;
|
||||
account_free(account);
|
||||
pthread_mutex_unlock(&lock);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user