mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 05:40:15 +01:00
glib-aux: accept zero bytes for nm_utils_random_bytes()
As an edge case, also accept requesting zero bytes of randomness.
This commit is contained in:
parent
3c349ee11b
commit
614e050b24
1 changed files with 3 additions and 1 deletions
|
|
@ -245,8 +245,10 @@ nm_utils_random_bytes(void *p, size_t n)
|
|||
gboolean has_high_quality = TRUE;
|
||||
guint8 *buf = p;
|
||||
|
||||
if (n == 0)
|
||||
return TRUE;
|
||||
|
||||
g_return_val_if_fail(p, FALSE);
|
||||
g_return_val_if_fail(n > 0, FALSE);
|
||||
|
||||
#if HAVE_GETRANDOM
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue