[svn-commits] rmudgett: trunk r420880 - in /trunk: ./ res/res_stasis_snoop.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Aug 12 18:36:39 CDT 2014


Author: rmudgett
Date: Tue Aug 12 18:36:37 2014
New Revision: 420880

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=420880
Log:
res_stasis_snoop.c: Fix off nominial exit path leaving Snoop channel locked and not hungup.

* Made use ast_copy_string() instead of strcpy() for snoop uniqueid for
safety.  There is no guarantee that the max channel uniqueid length will
remain the same as the snoop uniqueid space.
........

Merged revisions 420879 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/res/res_stasis_snoop.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-13-merged (original)
+++ branch-13-merged Tue Aug 12 18:36:37 2014
@@ -1,1 +1,1 @@
-/branches/13:1-420494,420514,420534,420536,420538,420562,420577,420592,420609,420624,420639,420657,420717,420742,420758,420779,420796,420803,420808,420837,420856
+/branches/13:1-420494,420514,420534,420536,420538,420562,420577,420592,420609,420624,420639,420657,420717,420742,420758,420779,420796,420803,420808,420837,420856,420879

Modified: trunk/res/res_stasis_snoop.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_stasis_snoop.c?view=diff&rev=420880&r1=420879&r2=420880
==============================================================================
--- trunk/res/res_stasis_snoop.c (original)
+++ trunk/res/res_stasis_snoop.c Tue Aug 12 18:36:37 2014
@@ -333,7 +333,7 @@
 		return NULL;
 	}
 
-	strcpy(snoop->uniqueid, ast_channel_uniqueid(chan));
+	ast_copy_string(snoop->uniqueid, ast_channel_uniqueid(chan), sizeof(snoop->uniqueid));
 
 	/* To keep the channel valid on the Snoop structure until it is destroyed we bump the ref up here */
 	ast_channel_ref(snoop->chan);
@@ -346,6 +346,8 @@
 	/* The format on the Snoop channel will be this signed linear format, and it will never change */
 	caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
 	if (!caps) {
+		ast_channel_unlock(snoop->chan);
+		ast_hangup(snoop->chan);
 		return NULL;
 	}
 	ast_format_cap_append(caps, snoop->spy_format, 0);




More information about the svn-commits mailing list