projects
/
NetworkManager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88da21c
)
utils: fix error open() handling
author
Lubomir Rintel
<lkundrak@v3.sk>
Thu, 21 Jan 2016 15:56:19 +0000
(16:56 +0100)
committer
Lubomir Rintel
<lkundrak@v3.sk>
Thu, 21 Jan 2016 15:56:19 +0000
(16:56 +0100)
CID 59376 (#2-1 of 2): Argument cannot be negative (NEGATIVE_RETURNS)
negative_returns: urandom is passed to a parameter that cannot be negative.
src/NetworkManagerUtils.c
patch
|
blob
|
history
diff --git
a/src/NetworkManagerUtils.c
b/src/NetworkManagerUtils.c
index
fb680d9
..
76116ac
100644
(file)
--- a/
src/NetworkManagerUtils.c
+++ b/
src/NetworkManagerUtils.c
@@
-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;