]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fix potential crash in close_mailbox (bug #4800)
authorRussell Bryant <russell@russellbryant.com>
Thu, 4 Aug 2005 23:03:56 +0000 (23:03 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 4 Aug 2005 23:03:56 +0000 (23:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@6284 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 6fc5deefa058163768c0b589f8f140cf6678fb0d..baf0ecbc159ab104bd0e52b8de521de26fb57cb8 100755 (executable)
@@ -2655,9 +2655,11 @@ static void close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
                        vm_delete(vms->fn);
                } 
                ast_unlock_path(vms->curdir);
-       } 
-       memset(vms->deleted, 0, sizeof(vms->deleted)); 
-       memset(vms->heard, 0, sizeof(vms->heard)); 
+       }
+       if (vms->deleted)
+               memset(vms->deleted, 0, sizeof(vms->deleted)); 
+       if (vms->heard)
+               memset(vms->heard, 0, sizeof(vms->heard)); 
 }
 
 static int vm_play_folder_name(struct ast_channel *chan, char *mbox)