socketpair: verify with a random value

... instead of using the curl time struct, since it would use a few
uninitialized bytes and the sanitizers would complain. This is a neater
approach I think.

Reported-by: Boris Kuschel
Fixes #10993
Closes #11015
This commit is contained in:
Daniel Stenberg 2023-04-24 14:14:11 +02:00
parent 2079cb26a1
commit a97e4eb95f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 12 additions and 6 deletions

View file

@ -183,8 +183,8 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd)
}
/*
* Curl_rand() stores 'num' number of random unsigned integers in the buffer
* 'rndptr' points to.
* Curl_rand() stores 'num' number of random unsigned characters in the buffer
* 'rnd' points to.
*
* If libcurl is built without TLS support or with a TLS backend that lacks a
* proper random API (rustls, Gskit or mbedTLS), this function will use "weak"