mirror of
https://github.com/curl/curl.git
synced 2025-02-05 14:30:10 +08:00
setopt: Address undefined behaviour by checking for null
This addresses undefined behaviour found using clang's UBsan: curl/lib/setopt.c:177:14: runtime error: applying non-zero offset 1 to null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior curl/lib/setopt.c:177:14 in Closes #10472
This commit is contained in:
parent
38262c944d
commit
635bf5a6b2
@ -174,7 +174,7 @@ static CURLcode protocol2num(const char *str, curl_prot_t *val)
|
||||
|
||||
*val |= h->protocol;
|
||||
}
|
||||
} while(str++);
|
||||
} while(str && str++);
|
||||
|
||||
if(!*val)
|
||||
/* no protocol listed */
|
||||
|
Loading…
Reference in New Issue
Block a user