summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2017-02-20 18:14:39 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-02-20 18:14:39 -0600
commit8287a012b6c9fe50ef62597d8487d6719e3f3aa7 (patch)
treebbd87c8077cb76fc55a4f4e34d4808c0576880a8
parentd7433aa796e686e05d280c5343f0c8b2b7d32458 (diff)
parent47daca8a2b9ee0f1cc5ab22478cf8dd92a97a3d4 (diff)
Merge "app_voicemail: vm_authenticate accesses uninitialized memory" into 13
-rw-r--r--apps/app_voicemail.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ef210c2ef..608977952 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11113,7 +11113,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_
return -1;
}
if (vmu && !skipuser) {
- memcpy(res_vmu, vmu, sizeof(struct ast_vm_user));
+ *res_vmu = *vmu;
}
return 0;
}
@@ -11275,8 +11275,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
int box;
int useadsi = 0;
int skipuser = 0;
- struct vm_state vms;
- struct ast_vm_user *vmu = NULL, vmus;
+ struct vm_state vms = {{0}};
+ struct ast_vm_user *vmu = NULL, vmus = {{0}};
char *context = NULL;
int silentexit = 0;
struct ast_flags flags = { 0 };
@@ -11289,12 +11289,8 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
#endif
/* Add the vm_state to the active list and keep it active */
- memset(&vms, 0, sizeof(vms));
-
vms.lastmsg = -1;
- memset(&vmus, 0, sizeof(vmus));
-
ast_test_suite_event_notify("START", "Message: vm_execmain started");
if (ast_channel_state(chan) != AST_STATE_UP) {
ast_debug(1, "Before ast_answer\n");
@@ -12587,7 +12583,7 @@ static struct ast_custom_function vm_info_acf = {
static int vmauthenticate(struct ast_channel *chan, const char *data)
{
char *s, *user = NULL, *context = NULL, mailbox[AST_MAX_EXTENSION] = "";
- struct ast_vm_user vmus;
+ struct ast_vm_user vmus = {{0}};
char *options = NULL;
int silent = 0, skipuser = 0;
int res = -1;