From: Dr. David von Oheimb Date: Thu, 10 Dec 2020 16:10:52 +0000 (+0100) Subject: apps.c: Fix crash in case uri arg of IS_HTTP or IS_HTTPS is NULL X-Git-Tag: openssl-3.0.0-alpha11~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=400e2acfe0bae9aec1f9df50fa51f6b7cf8ad779;p=thirdparty%2Fopenssl.git apps.c: Fix crash in case uri arg of IS_HTTP or IS_HTTPS is NULL Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/13712) --- diff --git a/apps/lib/apps.c b/apps/lib/apps.c index 1998a8bc2f5..457dac87bc4 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)