From: Jouni Malinen Date: Sun, 10 Jan 2010 20:08:43 +0000 (+0200) Subject: WPS ER: Verify os_get_random() return value X-Git-Tag: hostap_0_7_1~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f6050e79657d47570d90440cb3ec158147ea22f;p=thirdparty%2Fhostap.git WPS ER: Verify os_get_random() return value --- diff --git a/src/wps/wps_er.c b/src/wps/wps_er.c index 45de1618c..8950ab43e 100644 --- a/src/wps/wps_er.c +++ b/src/wps/wps_er.c @@ -1154,7 +1154,11 @@ wps_er_init(struct wps_context *wps, const char *ifname) os_strlcpy(er->ifname, ifname, sizeof(er->ifname)); er->wps = wps; - os_get_random((unsigned char *) &er->event_id, sizeof(er->event_id)); + if (os_get_random((unsigned char *) &er->event_id, + sizeof(er->event_id)) < 0) { + wps_er_deinit(er, NULL, NULL); + return NULL; + } if (get_netif_info(ifname, &er->ip_addr, &er->ip_addr_text, er->mac_addr)) {