aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-25 21:26:27 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-25 21:26:27 +0000
commite7d74753688993b826612469ae955e4162231154 (patch)
tree764dafd4b3da775d85b18a7c1c02493f3d7d34ed
parentac73a306cadbda581dfd609cb3371490a174a477 (diff)
Merged revisions 100378 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r100378 | qwell | 2008-01-25 15:24:49 -0600 (Fri, 25 Jan 2008) | 2 lines This would have never been true, since we're passing (sizeof(req.data) - 1) as the len to recvfrom(). ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@100379 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 3c42812c9..8a8ae8150 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -17778,11 +17778,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 (res == sizeof(req.data)) {
+ if (res == sizeof(req.data) - 1)
ast_debug(1, "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;
req.socket.fd = sipsock;