]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fixes voicemail.conf issues where mailboxes with passwords that don't precede a comma...
authorBrett Bryant <bbryant@digium.com>
Tue, 7 Sep 2010 17:45:41 +0000 (17:45 +0000)
committerBrett Bryant <bbryant@digium.com>
Tue, 7 Sep 2010 17:45:41 +0000 (17:45 +0000)
(closes issue #15726)
Reported by: 298
Patches:
      M15726.diff uploaded by junky (license 177)
Tested by: junky

Review: [full review board URL with trailing slash]

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@285194 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index a02ac78bf4ea0bc48437b870c7181651b66fe687..ead08664e2bc06f9c8c1009abe7987b04d3d0456 100644 (file)
@@ -915,11 +915,12 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
                                }
                                value = strstr(tmp,",");
                                if (!value) {
-                                       ast_log(LOG_WARNING, "variable has bad format.\n");
-                                       break;
+                                       new = alloca(strlen(newpassword)+1);
+                                       sprintf(new, "%s", newpassword);
+                               } else {
+                                       new = alloca((strlen(value)+strlen(newpassword)+1));
+                                       sprintf(new,"%s%s", newpassword, value);
                                }
-                               new = alloca((strlen(value)+strlen(newpassword)+1));
-                               sprintf(new,"%s%s", newpassword, value);
                                if (!(cat = ast_category_get(cfg, category))) {
                                        ast_log(LOG_WARNING, "Failed to get category structure.\n");
                                        break;