lib1537: check ptr against NULL before dereferencing it

Fixes #6707
Closes #6708
This commit is contained in:
kokke 2021-03-09 14:10:41 +01:00 committed by Daniel Stenberg
parent 9421eee915
commit b2d906754c
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -47,11 +47,11 @@ int test(char *URL)
/* deprecated API */
ptr = curl_escape((char *)a, asize);
printf("%s\n", ptr);
if(!ptr) {
res = TEST_ERR_MAJOR_BAD;
goto test_cleanup;
}
printf("%s\n", ptr);
raw = curl_easy_unescape(NULL, ptr, (int)strlen(ptr), &outlen);
printf("outlen == %d\n", outlen);