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)
This commit is contained in:
Dr. David von Oheimb 2020-12-10 17:10:52 +01:00 committed by Dr. David von Oheimb
parent e211d949cd
commit 400e2acfe0

View File

@ -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)