1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Fix: Fixed bugs in prng.c

This commit is contained in:
Philipp Schafft 2020-10-21 23:21:49 +00:00
parent 5176c7232b
commit a30b15df90

View File

@ -51,6 +51,8 @@ static void prng_initial_seed(void)
#endif #endif
} seed; } seed;
memset(&seed, 0, sizeof(seed));
seed.debian = 4; seed.debian = 4;
seed.t = time(NULL); seed.t = time(NULL);
#ifdef HAVE_UNAME #ifdef HAVE_UNAME
@ -158,12 +160,12 @@ ssize_t prng_read(void *buffer, size_t len)
while (ret < len) { while (ret < len) {
res = prng_read_block(froma, buffer + ret, len - ret); res = prng_read_block(froma, buffer + ret, len - ret);
if (res < 0) { if (res < 0) {
thread_mutex_unlock(&digest_a_lock); thread_mutex_unlock(&digest_b_lock);
return -1; return -1;
} }
ret += res; ret += res;
} }
thread_mutex_unlock(&digest_a_lock); thread_mutex_unlock(&digest_b_lock);
return ret; return ret;
} }