projects
/
mech_eap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7b96ec
)
WPS UPnP: Check os_get_random() result more consistently
author
Jouni Malinen
<j@w1.fi>
Sat, 11 Oct 2014 16:08:30 +0000
(19:08 +0300)
committer
Jouni Malinen
<j@w1.fi>
Sat, 11 Oct 2014 16:08:30 +0000
(19:08 +0300)
While the value here would not matter much, make the implementation more
consistent (CID 72692).
Signed-off-by: Jouni Malinen <j@w1.fi>
src/wps/wps_upnp_ssdp.c
patch
|
blob
|
history
diff --git
a/src/wps/wps_upnp_ssdp.c
b/src/wps/wps_upnp_ssdp.c
index
098571c
..
26a740d
100644
(file)
--- a/
src/wps/wps_upnp_ssdp.c
+++ b/
src/wps/wps_upnp_ssdp.c
@@
-317,7
+317,8
@@
static void advertisement_state_machine_handler(void *eloop_data,
* (see notes above)
*/
next_timeout_msec = 0;
- os_get_random((void *) &r, sizeof(r));
+ if (os_get_random((void *) &r, sizeof(r)) < 0)
+ r = 32768;
next_timeout_sec = UPNP_CACHE_SEC / 4 +
(((UPNP_CACHE_SEC / 4) * r) >> 16);
sm->advertise_count++;