lib: add asserts that hostname has content

For all network related protocols there must be a non-blank hostname
used. This change adds a few asserts in some places to make debug/tests
catch mistakes if any such would slip in.

Closes #19146
This commit is contained in:
Daniel Stenberg 2025-10-19 16:40:11 +02:00
parent 55e0526566
commit 7f19fa9819
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 6 additions and 1 deletions

View file

@ -458,6 +458,7 @@ struct Curl_addrinfo *Curl_doh(struct Curl_easy *data,
DEBUGASSERT(conn);
DEBUGASSERT(!data->state.async.doh);
DEBUGASSERT(hostname && hostname[0]);
if(data->state.async.doh)
Curl_doh_cleanup(data);