]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib1536: check ptr against NULL before dereferencing it
authorkokke <spam@rowdy.dk>
Tue, 9 Mar 2021 13:25:04 +0000 (14:25 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 10 Mar 2021 13:03:57 +0000 (14:03 +0100)
Closes #6710

tests/libtest/lib1536.c

index 7a1aa9bfabc91f0c66b119ed8962c660e8a00c8c..6fe3bc787f27b35aad2045b98f50856b0c0477f8 100644 (file)
@@ -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__,