[svn-commits] branch 1.2 r8677 - /branches/1.2/channels/chan_sip.c
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Wed Jan 25 12:14:45 MST 2006
Author: russell
Date: Wed Jan 25 13:14:43 2006
New Revision: 8677
URL: http://svn.digium.com/view/asterisk?rev=8677&view=rev
Log:
don't call ast_update_realtime with uninitialized variables if we get a
registration with an expirey of 0 seconds (issue #6173)
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=8677&r1=8676&r2=8677&view=diff
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Wed Jan 25 13:14:43 2006
@@ -1590,16 +1590,15 @@
{
char port[10];
char ipaddr[20];
- char regseconds[20] = "0";
+ char regseconds[20];
+ time_t nowtime;
- if (expirey) { /* Registration */
- time_t nowtime;
- time(&nowtime);
- nowtime += expirey;
- snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime); /* Expiration time */
- ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr);
- snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port));
- }
+ time(&nowtime);
+ nowtime += expirey;
+ snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime); /* Expiration time */
+ ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr);
+ snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port));
+
if (fullcontact)
ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr, "port", port, "regseconds", regseconds, "username", username, "fullcontact", fullcontact, NULL);
else
More information about the svn-commits
mailing list