From c6a3a11048097fcec9925b3da528eab9eb272c18 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Tue, 15 Mar 2011 15:54:21 +0200 Subject: [PATCH] Check select() return value in wpa_ctrl_request() Signed-off-by: Dmitry Shmidt --- src/common/wpa_ctrl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c index 546699bff..88d3a0264 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)