From: Selva Nair <[email protected]>
Change-Id: Id00006bf8ea705d02eff2cbfba7d841e1cdb6ae1
Signed-off-by: Selva Nair <[email protected]>
---
src/openvpn/socks.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/openvpn/socks.c b/src/openvpn/socks.c
index 6a672c25..2cf0cc9f 100644
--- a/src/openvpn/socks.c
+++ b/src/openvpn/socks.c
@@ -357,11 +357,16 @@ recv_socks_reply(socket_descriptor_t sd,
size = recv(sd, &c, 1, MSG_NOSIGNAL);
/* error? */
- if (size != 1)
+ if (size < 0)
{
msg(D_LINK_ERRORS | M_ERRNO, "recv_socks_reply: TCP port read
failed on recv()");
return false;
}
+ else if (size == 0)
+ {
+ msg(D_LINK_ERRORS, "ERROR: recv_socks_reply: empty response from
socks server");
+ return false;
+ }
if (len == 3)
{
--
2.34.1
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel