mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 12:05:47 +08:00
getrandom: it's MIN, not MAX
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
c9e4b69e9f
commit
6c420fa494
@ -51,7 +51,7 @@ getrandom (void *ptr, size_t len, unsigned int flags)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* Max. bytes returned by Linux call. */
|
/* Max. bytes returned by Linux call. */
|
||||||
len = MAX (len, (flags & GRND_RANDOM) ? 512 : 33554431);
|
len = MIN (len, (flags & GRND_RANDOM) ? 512 : 33554431);
|
||||||
__try
|
__try
|
||||||
{
|
{
|
||||||
if (!RtlGenRandom (ptr, len))
|
if (!RtlGenRandom (ptr, len))
|
||||||
|
@ -23,3 +23,5 @@ Bug Fixes
|
|||||||
- Fix a few problems which are the combined culprit of fork failing
|
- Fix a few problems which are the combined culprit of fork failing
|
||||||
when called recursively from a pthread.
|
when called recursively from a pthread.
|
||||||
Addresses: https://cygwin.com/ml/cygwin/2017-03/msg00113.html
|
Addresses: https://cygwin.com/ml/cygwin/2017-03/msg00113.html
|
||||||
|
|
||||||
|
- Fix potential buffer overflow in getrandom.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user