Issue 9527 - upon entering a folder, no message is selected (curmsg == -1), so deleting causes memory corruption (beyond bounds)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@63359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2
Tilghman Lesher 18 years ago
parent 71befa9884
commit 616e3502e7

@ -5443,21 +5443,24 @@ static int vm_execmain(struct ast_channel *chan, void *data)
} }
break; break;
case '7': case '7':
vms.deleted[vms.curmsg] = !vms.deleted[vms.curmsg]; if (vms.curmsg >= 0 && vms.curmsg <= vms.lastmsg) {
if (useadsi) vms.deleted[vms.curmsg] = !vms.deleted[vms.curmsg];
adsi_delete(chan, &vms); if (useadsi)
if (vms.deleted[vms.curmsg]) adsi_delete(chan, &vms);
cmd = ast_play_and_wait(chan, "vm-deleted"); if (vms.deleted[vms.curmsg])
else cmd = ast_play_and_wait(chan, "vm-deleted");
cmd = ast_play_and_wait(chan, "vm-undeleted"); else
if (ast_test_flag((&globalflags), VM_SKIPAFTERCMD)) { cmd = ast_play_and_wait(chan, "vm-undeleted");
if (vms.curmsg < vms.lastmsg) { if (ast_test_flag((&globalflags), VM_SKIPAFTERCMD)) {
vms.curmsg++; if (vms.curmsg < vms.lastmsg) {
cmd = play_message(chan, vmu, &vms); vms.curmsg++;
} else { cmd = play_message(chan, vmu, &vms);
cmd = ast_play_and_wait(chan, "vm-nomore"); } else {
cmd = ast_play_and_wait(chan, "vm-nomore");
}
} }
} } else /* Delete not valid if we haven't selected a message */
cmd = 0;
break; break;
case '8': case '8':

Loading…
Cancel
Save