mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
getentropy: fix UB if len==0
if len==0, an uninitalized variable would be returned
This commit is contained in:
parent
52ee0dd6d5
commit
ddf1750e42
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
int getentropy(void *buffer, size_t len)
|
||||
{
|
||||
int cs, ret;
|
||||
int cs, ret = 0;
|
||||
char *pos = buffer;
|
||||
|
||||
if (len > 256) {
|
||||
|
|
Loading…
Add table
Reference in a new issue