From: Jason Parker Date: Fri, 25 Jan 2008 21:24:49 +0000 (+0000) Subject: This would have never been true, since we're passing (sizeof(req.data) - 1) as the... X-Git-Tag: 1.4.18~12^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a70508ed3d62002026ad212bcf96d7255430df4f;p=thirdparty%2Fasterisk.git This would have never been true, since we're passing (sizeof(req.data) - 1) as the len to recvfrom(). git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100378 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1cd25b5160..dd8a6a5576 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -15330,11 +15330,10 @@ static int sipsock_read(int *id, int fd, short events, void *ignore) 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);