From: Kevin P. Fleming Date: Tue, 14 Oct 2008 09:31:50 +0000 (+0000) Subject: ensure that *all* fields in the req structure are cleared out before reusing it;... X-Git-Tag: 1.6.2.0-beta1~1131 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90e01fcb0b3dbacb85a277d0ce33706fe818eed3;p=thirdparty%2Fasterisk.git ensure that *all* fields in the req structure are cleared out before reusing it; has_to_tag was not cleared, which caused the second incoming call over a TCP socket to fail if pedantic checking was enabled git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@148695 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2dbc2d4873..fe93f3393c 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1,4 +1,4 @@ - /* +/* * Asterisk -- An open source telephony toolkit. * * Copyright (C) 1999 - 2006, Digium, Inc. @@ -2402,11 +2402,17 @@ static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_sessi goto cleanup; for (;;) { + struct ast_str *str_save; + + str_save = req.data; + memset(&req, 0, sizeof(req)); + req.data = str_save; ast_str_reset(req.data); + + str_save = reqcpy.data; + memset(&reqcpy, 0, sizeof(reqcpy)); + reqcpy.data = str_save; ast_str_reset(reqcpy.data); - req.len = 0; - req.ignore = 0; - req.debug = 0; req.socket.fd = ser->fd; if (ser->ssl) {