diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-16 22:46:33 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-16 22:46:33 +0000 |
commit | 0c9c6c5cd7be773e556e77199b3a72d91f8fc8f2 (patch) | |
tree | b69b258dc451dca2b20cc34230d1acdd24cce597 /channels/chan_sip.c | |
parent | ff2192c3f3f43a1088344d20f831f661a05b7220 (diff) |
Merged revisions 168976 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r168976 | mmichelson | 2009-01-16 16:43:09 -0600 (Fri, 16 Jan 2009) | 26 lines
Merged revisions 168975 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r168975 | mmichelson | 2009-01-16 16:42:13 -0600 (Fri, 16 Jan 2009) | 18 lines
Account for possible NULL pointer when we receive a 408 in response to a REGISTER
It may be that by the time we receive a reply to a REGISTER request, the attempt has
timed out and thus the registry structure pointed to by the corresponding sip_pvt has
gone away. This situation was handled properly for a 200 OK response, but the 408
case assumed that the sip_registry struct was non-NULL, thus potentially causing a crash
This commit fixes this assumption and prints out a message to the console if we should
receive a late 408 response to a REGISTER
(closes issue #14211)
Reported by: aborghi
Patches:
14211.diff uploaded by putnopvut (license 60)
Tested by: aborghi
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@168979 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5b0f0141f..af1660c5a 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -16107,7 +16107,11 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str break; case 408: /* Request timeout */ /* Got a timeout response, so reset the counter of failed responses */ - r->regattempts = 0; + if (r) { + r->regattempts = 0; + } else { + ast_log(LOG_WARNING, "Got a 408 response to our REGISTER on call %s after we had destroyed the registry object\n", p->callid); + } break; case 423: /* Interval too brief */ r->expiry = atoi(get_header(req, "Min-Expires")); |