[asterisk-commits] bebuild: tag 1.8.13.0-rc2 r367965 - in /tags/1.8.13.0-rc2: ./ channels/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed May 30 09:23:41 CDT 2012
Author: bebuild
Date: Wed May 30 09:23:36 2012
New Revision: 367965
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=367965
Log:
Merge r367781,367843,367266 for 1.8.13.0-rc2
Removed:
tags/1.8.13.0-rc2/asterisk-1.8.13.0-rc1-summary.html
tags/1.8.13.0-rc2/asterisk-1.8.13.0-rc1-summary.txt
Modified:
tags/1.8.13.0-rc2/ (props changed)
tags/1.8.13.0-rc2/.version
tags/1.8.13.0-rc2/ChangeLog
tags/1.8.13.0-rc2/channels/chan_iax2.c
tags/1.8.13.0-rc2/channels/chan_sip.c
tags/1.8.13.0-rc2/channels/chan_skinny.c
Propchange: tags/1.8.13.0-rc2/
------------------------------------------------------------------------------
svn:mergeinfo = /branches/1.8:367266,367781,367843
Modified: tags/1.8.13.0-rc2/.version
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.13.0-rc2/.version?view=diff&rev=367965&r1=367964&r2=367965
==============================================================================
--- tags/1.8.13.0-rc2/.version (original)
+++ tags/1.8.13.0-rc2/.version Wed May 30 09:23:36 2012
@@ -1,1 +1,1 @@
-1.8.13.0-rc1
+1.8.13.0-rc2
Modified: tags/1.8.13.0-rc2/ChangeLog
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.13.0-rc2/ChangeLog?view=diff&rev=367965&r1=367964&r2=367965
==============================================================================
--- tags/1.8.13.0-rc2/ChangeLog (original)
+++ tags/1.8.13.0-rc2/ChangeLog Wed May 30 09:23:36 2012
@@ -1,3 +1,24 @@
+2012-05-30 Asterisk Development Team <asteriskteam at digium.com>
+
+ * Asterisk 1.8.13.0-rc2 Released.
+
+ * Resolve crash in subscribing for MWI notifications.
+
+ ASTOBJ_UNREF sets the variable to NULL after unreffing it, so the
+ variable should definitely not be used after that. To solve this in
+ the two cases that affect subscribing for MWI notifications, we
+ instead save the ref locally, and unref them in the error
+ conditions.
+
+ (closes issue ASTERISK-19827)
+ Reported by: B. R.
+ Review: https://reviewboard.asterisk.org/r/1940/
+
+ * AST-2012-007
+
+ * AST-2012-008
+
+
2012-05-03 Asterisk Development Team <asteriskteam at digium.com>
* Asterisk 1.8.13.0-rc1 Released.
Modified: tags/1.8.13.0-rc2/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.13.0-rc2/channels/chan_iax2.c?view=diff&rev=367965&r1=367964&r2=367965
==============================================================================
--- tags/1.8.13.0-rc2/channels/chan_iax2.c (original)
+++ tags/1.8.13.0-rc2/channels/chan_iax2.c Wed May 30 09:23:36 2012
@@ -1842,24 +1842,25 @@
* we have received a destination call number. */
static int queue_signalling(struct chan_iax2_pvt *pvt, struct ast_frame *f)
{
- struct signaling_queue_entry *new;
+ struct signaling_queue_entry *qe;
if (f->frametype == AST_FRAME_IAX || !pvt->hold_signaling) {
return 1; /* do not queue this frame */
- } else if (!(new = ast_calloc(1, sizeof(struct signaling_queue_entry)))) {
+ } else if (!(qe = ast_calloc(1, sizeof(struct signaling_queue_entry)))) {
return -1; /* out of memory */
}
- memcpy(&new->f, f, sizeof(new->f)); /* copy ast_frame into our queue entry */
-
- if (new->f.datalen) { /* if there is data in this frame copy it over as well */
- if (!(new->f.data.ptr = ast_calloc(1, new->f.datalen))) {
- free_signaling_queue_entry(new);
+ /* copy ast_frame into our queue entry */
+ qe->f = *f;
+ if (qe->f.datalen) {
+ /* if there is data in this frame copy it over as well */
+ if (!(qe->f.data.ptr = ast_malloc(qe->f.datalen))) {
+ free_signaling_queue_entry(qe);
return -1;
}
- memcpy(new->f.data.ptr, f->data.ptr, sizeof(*new->f.data.ptr));
- }
- AST_LIST_INSERT_TAIL(&pvt->signaling_queue, new, next);
+ memcpy(qe->f.data.ptr, f->data.ptr, qe->f.datalen);
+ }
+ AST_LIST_INSERT_TAIL(&pvt->signaling_queue, qe, next);
return 0;
}
@@ -4160,7 +4161,16 @@
int needfree = 0;
struct ast_channel *owner = NULL;
struct ast_channel *bridge = NULL;
-
+
+ /*
+ * Clear fr->af.data if there is no data in the buffer. Things
+ * like AST_CONTROL_HOLD without a suggested music class must
+ * have a NULL pointer.
+ */
+ if (!fr->af.datalen) {
+ memset(&fr->af.data, 0, sizeof(fr->af.data));
+ }
+
/* Attempt to recover wrapped timestamps */
unwrap_timestamp(fr);
Modified: tags/1.8.13.0-rc2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.13.0-rc2/channels/chan_sip.c?view=diff&rev=367965&r1=367964&r2=367965
==============================================================================
--- tags/1.8.13.0-rc2/channels/chan_sip.c (original)
+++ tags/1.8.13.0-rc2/channels/chan_sip.c Wed May 30 09:23:36 2012
@@ -12419,13 +12419,14 @@
/* If we have no DNS manager let's do a lookup */
if (!mwi->dnsmgr) {
char transport[MAXHOSTNAMELEN];
+ struct sip_subscription_mwi *saved;
snprintf(transport, sizeof(transport), "_%s._%s", get_srv_service(mwi->transport), get_srv_protocol(mwi->transport));
mwi->us.ss.ss_family = get_address_family_filter(&bindaddr); /* Filter address family */
- ASTOBJ_REF(mwi); /* Add a ref for storing the mwi on the dnsmgr for updates */
- ast_dnsmgr_lookup_cb(mwi->hostname, &mwi->us, &mwi->dnsmgr, sip_cfg.srvlookup ? transport : NULL, on_dns_update_mwi, mwi);
+ saved = ASTOBJ_REF(mwi);
+ ast_dnsmgr_lookup_cb(mwi->hostname, &mwi->us, &mwi->dnsmgr, sip_cfg.srvlookup ? transport : NULL, on_dns_update_mwi, saved);
if (!mwi->dnsmgr) {
- ASTOBJ_UNREF(mwi, sip_subscribe_mwi_destroy); /* dnsmgr disabled, remove reference */
+ ASTOBJ_UNREF(saved, sip_subscribe_mwi_destroy); /* dnsmgr disabled, remove reference */
}
}
@@ -29570,10 +29571,12 @@
static void sip_send_all_mwi_subscriptions(void)
{
ASTOBJ_CONTAINER_TRAVERSE(&submwil, 1, do {
+ struct sip_subscription_mwi *saved;
ASTOBJ_WRLOCK(iterator);
AST_SCHED_DEL(sched, iterator->resub);
- if ((iterator->resub = ast_sched_add(sched, 1, sip_subscribe_mwi_do, ASTOBJ_REF(iterator))) < 0) {
- ASTOBJ_UNREF(iterator, sip_subscribe_mwi_destroy);
+ saved = ASTOBJ_REF(iterator);
+ if ((iterator->resub = ast_sched_add(sched, 1, sip_subscribe_mwi_do, saved)) < 0) {
+ ASTOBJ_UNREF(saved, sip_subscribe_mwi_destroy);
}
ASTOBJ_UNLOCK(iterator);
} while (0));
Modified: tags/1.8.13.0-rc2/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.13.0-rc2/channels/chan_skinny.c?view=diff&rev=367965&r1=367964&r2=367965
==============================================================================
--- tags/1.8.13.0-rc2/channels/chan_skinny.c (original)
+++ tags/1.8.13.0-rc2/channels/chan_skinny.c Wed May 30 09:23:36 2012
@@ -2677,6 +2677,10 @@
struct skinny_line *l = sub->parent;
struct skinny_device *d = l->device;
+ if (!d) {
+ return;
+ }
+
if (!c->caller.id.number.valid
|| ast_strlen_zero(c->caller.id.number.str)
|| !c->connected.id.number.valid
@@ -3810,6 +3814,11 @@
int res = 0;
int loop_pause = 100;
+ if (!d) {
+ ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+ return NULL;
+ }
+
ast_verb(3, "Starting simple switch on '%s@%s'\n", l->name, d->name);
len = strlen(d->exten);
@@ -3913,7 +3922,7 @@
struct skinny_line *l = sub->parent;
struct skinny_device *d = l->device;
- if (!d->registered) {
+ if (!d || !d->registered) {
ast_log(LOG_ERROR, "Device not registered, cannot call %s\n", dest);
return -1;
}
@@ -3976,6 +3985,11 @@
l = sub->parent;
d = l->device;
+
+ if (!d) {
+ ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+ return 0;
+ }
if (skinnydebug)
ast_verb(3,"Hanging up %s/%d\n",d->name,sub->callid);
@@ -4374,7 +4388,13 @@
struct skinny_subchannel *sub = ast->tech_pvt;
struct skinny_line *l = sub->parent;
struct skinny_device *d = l->device;
- struct skinnysession *s = d->session;
+ struct skinnysession *s;
+
+ if (!d) {
+ ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+ return -1;
+ }
+ s = d->session;
if (!s) {
ast_log(LOG_NOTICE, "Asked to indicate '%s' condition on channel %s, but session does not exist.\n", control2str(ind), ast->name);
@@ -4608,8 +4628,13 @@
struct skinny_device *d = l->device;
/* Don't try to hold a channel that doesn't exist */
- if (!sub || !sub->owner)
+ if (!sub || !sub->owner) {
return 0;
+ }
+ if (!d) {
+ ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+ return 0;
+ }
/* Channel needs to be put on hold */
if (skinnydebug)
@@ -4635,8 +4660,13 @@
struct skinny_device *d = l->device;
/* Don't try to unhold a channel that doesn't exist */
- if (!sub || !sub->owner)
+ if (!sub || !sub->owner) {
return 0;
+ }
+ if (!d) {
+ ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+ return 0;
+ }
/* Channel is on hold, so we will unhold */
if (skinnydebug)
@@ -4689,6 +4719,11 @@
l = sub->parent;
d = l->device;
+
+ if (!d) {
+ ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+ return -1;
+ }
if (!sub->related) {
/* Another sub has not been created so this must be first XFER press */
@@ -4820,6 +4855,11 @@
struct skinny_device *d = l->device;
struct ast_channel *c = sub->owner;
pthread_t t;
+
+ if (!d) {
+ ast_log(LOG_WARNING, "Device for line %s is not registered.\n", l->name);
+ return 0;
+ }
if (l->hookstate == SKINNY_ONHOOK) {
l->hookstate = SKINNY_OFFHOOK;
More information about the asterisk-commits
mailing list