Ensure the TCP read buffer is fully initialized before handling each packet.
authorRussell Bryant <russell@russellbryant.com>
Fri, 26 Jun 2009 20:45:00 +0000 (20:45 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 26 Jun 2009 20:45:00 +0000 (20:45 +0000)
(closes issue #14452)
Reported by: umberto71

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203779 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index a49b6ce..0ab1251 100644 (file)
@@ -2903,6 +2903,8 @@ static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_sessi
                reqcpy.data = str_save;
                ast_str_reset(reqcpy.data);
 
+               memset(buf, 0, sizeof(buf));
+
                if (tcptls_session->ssl) {
                        set_socket_transport(&req.socket, SIP_TRANSPORT_TLS);
                        req.socket.port = htons(ourport_tls);