Fix uninitialized value in struct ast_control_pvt_cause_code usage.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@397744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2013-08-27 16:40:46 +00:00
parent 4fd979228d
commit fdc86bb44c
7 changed files with 10 additions and 4 deletions
+1
View File
@@ -4246,6 +4246,7 @@ static void dahdi_r2_on_call_disconnect(openr2_chan_t *r2chan, openr2_call_disco
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));
+1
View File
@@ -10243,6 +10243,7 @@ static int socket_process_helper(struct iax2_thread *thread)
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;
+4 -4
View File
@@ -2373,7 +2373,8 @@ static void jingle_action_session_terminate(struct jingle_endpoint *endpoint, st
/* 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++) {
@@ -2387,7 +2388,8 @@ static void jingle_action_session_terminate(struct jingle_endpoint *endpoint, st
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);
@@ -2395,8 +2397,6 @@ static void jingle_action_session_terminate(struct jingle_endpoint *endpoint, st
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);
session->gone = 1;
+1
View File
@@ -28069,6 +28069,7 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct as
/* 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);
+1
View File
@@ -2734,6 +2734,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
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);
+1
View File
@@ -1296,6 +1296,7 @@ static void pri_queue_pvt_cause_data(struct sig_pri_span *pri, int chanpos, cons
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));
+1
View File
@@ -411,6 +411,7 @@ static void ss7_queue_pvt_cause_data(struct ast_channel *owner, const char *caus
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));