reading negative size is wrong, zero is ok

This commit is contained in:
Love Hornquist Astrand
2009-09-25 14:53:31 -07:00
parent 9bace01559
commit ec263fc5a4

View File

@@ -95,8 +95,10 @@ unix_bytes(unsigned char *outdata, int size)
ssize_t count;
int once = 0;
if (size <= 0)
if (size < 0)
return 0;
else if (size == 0)
return 1;
HEIMDAL_MUTEX_lock(&random_mutex);
if (random_fd == -1) {