[svn-commits] rmudgett: trunk r397746 - in /trunk: ./ channels/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Aug 27 11:51:12 CDT 2013
Author: rmudgett
Date: Tue Aug 27 11:51:08 2013
New Revision: 397746
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397746
Log:
Fix uninitialized value in struct ast_control_pvt_cause_code usage.
........
Merged revisions 397744 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 397745 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
trunk/ (props changed)
trunk/channels/chan_dahdi.c
trunk/channels/chan_iax2.c
trunk/channels/chan_motif.c
trunk/channels/chan_sip.c
trunk/channels/sig_analog.c
trunk/channels/sig_pri.c
trunk/channels/sig_ss7.c
Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Tue Aug 27 11:51:08 2013
@@ -1,1 +1,1 @@
-/branches/12:1-397673,397690
+/branches/12:1-397673,397690,397745
Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=397746&r1=397745&r2=397746
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Tue Aug 27 11:51:08 2013
@@ -3686,6 +3686,7 @@
snprintf(cause_str, sizeof(cause_str), "R2 DISCONNECT (%s)", openr2_proto_get_disconnect_string(cause));
datalen += strlen(cause_str);
cause_code = ast_alloca(datalen);
+ memset(cause_code, 0, datalen);
cause_code->ast_cause = dahdi_r2_cause_to_ast_cause(cause);
ast_copy_string(cause_code->chan_name, ast_channel_name(p->owner), AST_CHANNEL_NAME);
ast_copy_string(cause_code->code, cause_str, datalen + 1 - sizeof(*cause_code));
Modified: trunk/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=397746&r1=397745&r2=397746
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Tue Aug 27 11:51:08 2013
@@ -9996,6 +9996,7 @@
data_size += strlen(subclass);
cause_code = ast_alloca(data_size);
+ memset(cause_code, 0, data_size);
ast_copy_string(cause_code->chan_name, ast_channel_name(iaxs[fr->callno]->owner), AST_CHANNEL_NAME);
cause_code->ast_cause = ies.causecode;
Modified: trunk/channels/chan_motif.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_motif.c?view=diff&rev=397746&r1=397745&r2=397746
==============================================================================
--- trunk/channels/chan_motif.c (original)
+++ trunk/channels/chan_motif.c Tue Aug 27 11:51:08 2013
@@ -2532,7 +2532,8 @@
/* Size of the string making up the cause code is "Motif " + text */
data_size += 6 + strlen(iks_name(text));
- cause_code = ast_malloc(data_size);
+ cause_code = ast_alloca(data_size);
+ memset(cause_code, 0, data_size);
/* Get the appropriate cause code mapping for this reason */
for (i = 0; i < ARRAY_LEN(jingle_reason_mappings); i++) {
@@ -2546,15 +2547,14 @@
snprintf(cause_code->code, data_size - sizeof(*cause_code) + 1, "Motif %s", iks_name(text));
} else {
/* No technology specific information is available */
- cause_code = ast_malloc(data_size);
+ cause_code = ast_alloca(data_size);
+ memset(cause_code, 0, data_size);
}
ast_copy_string(cause_code->chan_name, ast_channel_name(chan), AST_CHANNEL_NAME);
cause_code->ast_cause = cause;
ast_queue_control_data(chan, AST_CONTROL_PVT_CAUSE_CODE, cause_code, data_size);
ast_channel_hangupcause_hash_set(chan, cause_code, data_size);
-
- ast_free(cause_code);
ast_debug(3, "Hanging up channel '%s' due to session terminate message with cause '%d'\n", ast_channel_name(chan), cause);
ast_queue_hangup_with_cause(chan, cause);
Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=397746&r1=397745&r2=397746
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Aug 27 11:51:08 2013
@@ -27987,6 +27987,7 @@
/* size of the string making up the cause code is "SIP " + cause length */
data_size += 4 + strlen(REQ_OFFSET_TO_STR(req, rlpart2));
cause_code = ast_alloca(data_size);
+ memset(cause_code, 0, data_size);
ast_copy_string(cause_code->chan_name, ast_channel_name(p->owner), AST_CHANNEL_NAME);
Modified: trunk/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_analog.c?view=diff&rev=397746&r1=397745&r2=397746
==============================================================================
--- trunk/channels/sig_analog.c (original)
+++ trunk/channels/sig_analog.c Tue Aug 27 11:51:08 2013
@@ -2715,6 +2715,7 @@
subclass = analog_event2str(res);
data_size += strlen(subclass);
cause_code = ast_alloca(data_size);
+ memset(cause_code, 0, data_size);
cause_code->ast_cause = AST_CAUSE_NORMAL_CLEARING;
ast_copy_string(cause_code->chan_name, ast_channel_name(ast), AST_CHANNEL_NAME);
snprintf(cause_code->code, data_size - sizeof(*cause_code) + 1, "ANALOG %s", subclass);
Modified: trunk/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_pri.c?view=diff&rev=397746&r1=397745&r2=397746
==============================================================================
--- trunk/channels/sig_pri.c (original)
+++ trunk/channels/sig_pri.c Tue Aug 27 11:51:08 2013
@@ -1404,6 +1404,7 @@
if (chan) {
int datalen = sizeof(*cause_code) + strlen(cause);
cause_code = ast_alloca(datalen);
+ memset(cause_code, 0, datalen);
cause_code->ast_cause = ast_cause;
ast_copy_string(cause_code->chan_name, ast_channel_name(chan), AST_CHANNEL_NAME);
ast_copy_string(cause_code->code, cause, datalen + 1 - sizeof(*cause_code));
Modified: trunk/channels/sig_ss7.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_ss7.c?view=diff&rev=397746&r1=397745&r2=397746
==============================================================================
--- trunk/channels/sig_ss7.c (original)
+++ trunk/channels/sig_ss7.c Tue Aug 27 11:51:08 2013
@@ -411,6 +411,7 @@
int datalen = sizeof(*cause_code) + strlen(cause);
cause_code = ast_alloca(datalen);
+ memset(cause_code, 0, datalen);
cause_code->ast_cause = ast_cause;
ast_copy_string(cause_code->chan_name, ast_channel_name(owner), AST_CHANNEL_NAME);
ast_copy_string(cause_code->code, cause, datalen + 1 - sizeof(*cause_code));
More information about the svn-commits
mailing list