aboutgitcodebugslistschat
path: root/tcp_splice.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcp_splice.c')
-rw-r--r--tcp_splice.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tcp_splice.c b/tcp_splice.c
index cb8df7b..d374785 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -418,6 +418,14 @@ static int tcp_splice_connect(struct ctx *c, struct tcp_splice_conn *conn,
const struct sockaddr *sa;
socklen_t sl;
+ if (sock_conn < 0)
+ return -errno;
+
+ if (sock_conn > SOCKET_MAX) {
+ close(sock_conn);
+ return -EIO;
+ }
+
conn->b = sock_conn;
if (s < 0)