getentropy: fix UB if len==0
if len==0, an uninitalized variable would be returned
This commit is contained in:
committed by
Rich Felker
parent
52ee0dd6d5
commit
ddf1750e42
@@ -6,7 +6,7 @@
|
||||
|
||||
int getentropy(void *buffer, size_t len)
|
||||
{
|
||||
int cs, ret;
|
||||
int cs, ret = 0;
|
||||
char *pos = buffer;
|
||||
|
||||
if (len > 256) {
|
||||
|
||||
Reference in New Issue
Block a user