From: Amitay Isaacs Date: Thu, 26 Jul 2018 04:51:44 +0000 (+1000) Subject: ctdb-common: Fix the TCP packet length check X-Git-Tag: ldb-1.5.0~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be43e08072ebce937ed0a02cd8d9d1c6072b178d;p=thirdparty%2Fsamba.git ctdb-common: Fix the TCP packet length check BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/common/system_socket.c b/ctdb/common/system_socket.c index 562b2bf1aaf..22776f73ea5 100644 --- a/ctdb/common/system_socket.c +++ b/ctdb/common/system_socket.c @@ -775,7 +775,7 @@ int ctdb_sys_read_tcp_packet(int s, /* make sure its not a short packet */ if (offsetof(struct tcphdr, th_ack) + 4 + - (ip->ip_hl*4) > ret) { + (ip->ip_hl*4) > pkthdr.len) { return -1; } /* TCP */