mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-25 11:50:38 +01:00
utils: fix error open() handling
CID 59376 (#2-1 of 2): Argument cannot be negative (NEGATIVE_RETURNS) negative_returns: urandom is passed to a parameter that cannot be negative.
This commit is contained in:
parent
88da21caa1
commit
e80346fff7
1 changed files with 1 additions and 1 deletions
|
|
@ -3416,7 +3416,7 @@ nm_utils_ipv6_addr_set_stable_privacy (struct in6_addr *addr,
|
|||
int urandom = open ("/dev/urandom", O_RDONLY);
|
||||
mode_t key_mask;
|
||||
|
||||
if (!urandom) {
|
||||
if (urandom == -1) {
|
||||
g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||
"Can't open /dev/urandom: %s", strerror (errno));
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue