[PATCH] Check select() return value in wpa_ctrl_request()
    Dmitry Shmidt 
    dimitrysh at google.com
       
    Fri Mar  4 13:44:59 EST 2011
    
    
  
Signed-off-by: Dmitry Shmidt <dimitrysh at google.com>
---
 src/common/wpa_ctrl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c
index 546699b..88d3a02 100644
--- a/src/common/wpa_ctrl.c
+++ b/src/common/wpa_ctrl.c
@@ -282,6 +282,8 @@ int wpa_ctrl_request(struct wpa_ctrl *ctrl, const
char *cmd, size_t cmd_len,
 		FD_ZERO(&rfds);
 		FD_SET(ctrl->s, &rfds);
 		res = select(ctrl->s + 1, &rfds, NULL, NULL, &tv);
+		if (res < 0)
+			return res;
 		if (FD_ISSET(ctrl->s, &rfds)) {
 			res = recv(ctrl->s, reply, *reply_len, 0);
 			if (res < 0)
-- 
1.7.3.1
    
    
More information about the HostAP
mailing list