From 4088b25b337d67fa34e96e90cf98dd3865ce2d33 Mon Sep 17 00:00:00 2001 From: kokke Date: Tue, 9 Mar 2021 14:25:04 +0100 Subject: [PATCH] lib1536: check ptr against NULL before dereferencing it Closes #6710 --- tests/libtest/lib1536.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libtest/lib1536.c b/tests/libtest/lib1536.c index 7a1aa9bfa..6fe3bc787 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__,