diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2006-11-28 00:22:05 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2006-11-28 00:22:05 +0000 |
| commit | 34b55f20129e947d53d252f7ba22392d2e5be778 (patch) | |
| tree | 1d9b552a552ebf7747ab66487b4b04184f57e30c /ext/soap/php_http.c | |
| parent | 9503b966ec9c590ac23a84ef9fa947b811df45dc (diff) | |
| download | php-git-34b55f20129e947d53d252f7ba22392d2e5be778.tar.gz | |
Replace non-threadsafe rand() with php_rand_r()
Diffstat (limited to 'ext/soap/php_http.c')
| -rw-r--r-- | ext/soap/php_http.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index b5df837dc7..e0ca155e05 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -469,9 +469,10 @@ try_again: char HA1[33], HA2[33], response[33], cnonce[33], nc[9]; PHP_MD5_CTX md5ctx; unsigned char hash[16]; + unsigned int ctx; PHP_MD5Init(&md5ctx); - sprintf(cnonce, "%d", rand()); + sprintf(cnonce, "%d", php_rand_r(&ctx)); PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce)); PHP_MD5Final(hash, &md5ctx); make_digest(cnonce, hash); |
