From: kokke Date: Tue, 9 Mar 2021 13:25:04 +0000 (+0100) Subject: lib1536: check ptr against NULL before dereferencing it X-Git-Tag: curl-7_76_0~89 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4088b25b337d67fa34e96e90cf98dd3865ce2d33;p=thirdparty%2Fcurl.git lib1536: check ptr against NULL before dereferencing it Closes #6710 --- diff --git a/tests/libtest/lib1536.c b/tests/libtest/lib1536.c index 7a1aa9bfab..6fe3bc787f 100644 --- a/tests/libtest/lib1536.c +++ b/tests/libtest/lib1536.c @@ -69,7 +69,7 @@ int test(char *URL) __FILE__, __LINE__, res, curl_easy_strerror(res)); goto test_cleanup; } - if(memcmp(scheme, "HTTP", 5) != 0) { + if(scheme == NULL || memcmp(scheme, "HTTP", 5) != 0) { fprintf(stderr, "%s:%d scheme of http resource is incorrect; " "expected 'HTTP' but is %s\n", __FILE__, __LINE__,