Fix for potential crash with vmexten
authorJason Parker <jparker@digium.com>
Mon, 14 Jan 2008 17:18:35 +0000 (17:18 +0000)
committerJason Parker <jparker@digium.com>
Mon, 14 Jan 2008 17:18:35 +0000 (17:18 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98773 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_skinny.c

index 6c526d4..9cf8cf5 100644 (file)
@@ -2770,6 +2770,9 @@ static struct skinny_device *build_device(const char *cat, struct ast_variable *
                d->prefs = default_prefs;
                if (!ast_strlen_zero(vmexten))
                        ast_copy_string(device_vmexten, vmexten, sizeof(device_vmexten));
+               else
+                       memset(device_vmexten, 0, sizeof(device_vmexten));
+
                while(v) {
                        if (!strcasecmp(v->name, "host")) {
                                if (ast_get_ip(&d->addr, v->value)) {
@@ -2904,8 +2907,7 @@ static struct skinny_device *build_device(const char *cat, struct ast_variable *
                                        ast_copy_string(l->mailbox, mailbox, sizeof(l->mailbox));
                                        if (!ast_strlen_zero(mailbox))
                                                ast_verb(3, "Setting mailbox '%s' on %s@%s\n", mailbox, d->name, l->name);
-                                       if (!ast_strlen_zero(device_vmexten))
-                                               ast_copy_string(l->vmexten, device_vmexten, sizeof(vmexten));
+                                       ast_copy_string(l->vmexten, device_vmexten, sizeof(vmexten));
                                        l->chanvars = chanvars;
                                        l->msgstate = -1;
                                        l->capability = d->capability;