[asterisk-commits] qwell: branch 1.4 r100378 - /branches/1.4/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 25 15:24:49 CST 2008


Author: qwell
Date: Fri Jan 25 15:24:49 2008
New Revision: 100378

URL: http://svn.digium.com/view/asterisk?view=rev&rev=100378
Log:
This would have never been true, since we're passing (sizeof(req.data) - 1) as the len to recvfrom().

Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=100378&r1=100377&r2=100378
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Fri Jan 25 15:24:49 2008
@@ -15330,11 +15330,10 @@
 			ast_log(LOG_WARNING, "Recv error: %s\n", strerror(errno));
 		return 1;
 	}
-	if (option_debug && res == sizeof(req.data)) {
+	if (option_debug && res == sizeof(req.data) - 1)
 		ast_log(LOG_DEBUG, "Received packet exceeds buffer. Data is possibly lost\n");
-		req.data[sizeof(req.data) - 1] = '\0';
-	} else
-		req.data[res] = '\0';
+
+	req.data[res] = '\0';
 	req.len = res;
 	if(sip_debug_test_addr(&sin))	/* Set the debug flag early on packet level */
 		ast_set_flag(&req, SIP_PKT_DEBUG);




More information about the asterisk-commits mailing list