diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-12-10 17:10:52 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-01-11 19:35:34 +0100 |
commit | 400e2acfe0bae9aec1f9df50fa51f6b7cf8ad779 (patch) | |
tree | 094968bad2f2b907e3808231db10e15e00cec943 /apps/lib/apps.c | |
parent | e211d949cd5737e53cd3399e6a88453930768b98 (diff) |
apps.c: Fix crash in case uri arg of IS_HTTP or IS_HTTPS is NULL
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13712)
Diffstat (limited to 'apps/lib/apps.c')
-rw-r--r-- | apps/lib/apps.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/lib/apps.c b/apps/lib/apps.c index 1998a8bc2f..457dac87bc 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -469,10 +469,10 @@ CONF *app_load_config_modules(const char *configfile) return conf; } -#define IS_HTTP(uri) \ - (strncmp(uri, OSSL_HTTP_PREFIX, strlen(OSSL_HTTP_PREFIX)) == 0) -#define IS_HTTPS(uri) \ - (strncmp(uri, OSSL_HTTPS_PREFIX, strlen(OSSL_HTTPS_PREFIX)) == 0) +#define IS_HTTP(uri) ((uri) != NULL \ + && strncmp(uri, OSSL_HTTP_PREFIX, strlen(OSSL_HTTP_PREFIX)) == 0) +#define IS_HTTPS(uri) ((uri) != NULL \ + && strncmp(uri, OSSL_HTTPS_PREFIX, strlen(OSSL_HTTPS_PREFIX)) == 0) X509 *load_cert_pass(const char *uri, int maybe_stdin, const char *pass, const char *desc) |