diff options
| author | Maxi Wuttke <mwuttke97@posteo.de> | 2022-04-01 21:07:43 +0200 |
|---|---|---|
| committer | Michael Vetter <jubalh@iodoru.org> | 2022-04-02 01:15:34 +0200 |
| commit | f11ad1671449f0c83ce28f0cd67af87ca4a585e5 (patch) | |
| tree | adcaddcbfe9f6675d8d8dda93b530909070c0edd /src/tools | |
| parent | cef0c5e927d51afaf89c308749602e68deb91afb (diff) | |
| download | profani-tty-f11ad1671449f0c83ce28f0cd67af87ca4a585e5.tar.gz | |
Fix a segfault when uploading or downloading files
The variable `ccount->tls_policy` was not null-tested before `strcmp`.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/http_download.c | 2 | ||||
| -rw-r--r-- | src/tools/http_upload.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/http_download.c b/src/tools/http_download.c index 57e36e61..bbbccce1 100644 --- a/src/tools/http_download.c +++ b/src/tools/http_download.c @@ -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); diff --git a/src/tools/http_upload.c b/src/tools/http_upload.c index 5b783441..4dae41c5 100644 --- a/src/tools/http_upload.c +++ b/src/tools/http_upload.c @@ -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); |