[asterisk-commits] branch 1.2 r29052 - /branches/1.2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat May 20 12:50:42 MST 2006


Author: russell
Date: Sat May 20 14:50:41 2006
New Revision: 29052

URL: http://svn.digium.com/view/asterisk?rev=29052&view=rev
Log:
fix the possibility of writing one byte past the end of a buffer.
(issue #7189, Mithraen)

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?rev=29052&r1=29051&r2=29052&view=diff
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Sat May 20 14:50:41 2006
@@ -11215,8 +11215,9 @@
 	}
 	if (res == sizeof(req.data)) {
 		ast_log(LOG_DEBUG, "Received packet exceeds buffer. Data is possibly lost\n");
-	}
-	req.data[res] = '\0';
+		req.data[sizeof(req.data) - 1] = '\0';
+	} else
+		req.data[res] = '\0';
 	req.len = res;
 	if(sip_debug_test_addr(&sin))
 		ast_set_flag(&req, SIP_PKT_DEBUG);



More information about the asterisk-commits mailing list