1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-15 14:05:03 -05:00

lib1536: check ptr against NULL before dereferencing it

Closes #6710
This commit is contained in:
kokke 2021-03-09 14:25:04 +01:00 committed by Daniel Stenberg
parent b2d906754c
commit 4088b25b33
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -69,7 +69,7 @@ int test(char *URL)
__FILE__, __LINE__, res, curl_easy_strerror(res)); __FILE__, __LINE__, res, curl_easy_strerror(res));
goto test_cleanup; 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; " fprintf(stderr, "%s:%d scheme of http resource is incorrect; "
"expected 'HTTP' but is %s\n", "expected 'HTTP' but is %s\n",
__FILE__, __LINE__, __FILE__, __LINE__,