[asterisk-bugs] [JIRA] (ASTERISK-23713) Voicemail on FS overwrites last message when last index = MSGLIMIT

Michael L. Young (JIRA) noreply at issues.asterisk.org
Tue May 6 09:31:43 CDT 2014


    [ https://issues.asterisk.org/jira/browse/ASTERISK-23713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=217945#comment-217945 ] 

Michael L. Young commented on ASTERISK-23713:
---------------------------------------------

Miguel,
Thanks for the patch.  You need to attach patches as files so that it falls under the license agreement that you need to sign if you haven't done so already.  We cannot accept inline patches.

Can you please attach a full debug log?  At least debug level of 4 since there is a debug message that will help track how the index is being determined.

[Collecting Debug Information | https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information]

I am not seeing where your patch solves the real issue.  MAXMSGLIMIT is not set by the admin.  There is a global setting, maxmsg, that is set by the admin.  Then there is a per user setting, vmu->maxmsg.  I don't think we should change that for the default per directory message limit MAXMSGLIMIT.

There might be a problem elsewhere with handling properly what is being returned by this function.  The debug log would be helpful to getting started on looking at this sooner.

> Voicemail on FS overwrites last message when last index = MSGLIMIT
> ------------------------------------------------------------------
>
>                 Key: ASTERISK-23713
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23713
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_voicemail
>    Affects Versions: SVN, 12.2.0
>         Environment: app_voicemail delivery on filesystem.
> Any asterisk supported platform is probably affected.
>            Reporter: Miguel Tavares
>            Assignee: Miguel Tavares
>
> When leaving a voicemail the function last_message_index will stop at index only until the default or configured max messages (vmu->maxmsg) although it should continue until MAXMSGLIMIT.
> Example, let's say the asterisk admin set the maximum messages to 10, the user received 10 messages and then deleted 9 apart from the last one. In the filesystem the files msg0010.txt and msg0010.wav will be present.
> The last_message_index will detect that that's the only message available but then  when finding out what's the index it will stop at 9 (the configure maximum when counting from 0) and return that as the last message index, making he voicemail app to overwrite the previous existing last message.
> Possible fix, in app_voicemail.c
> {noformat}
> 112a113
> > #include <string.h>
> 4434c4435
> <       unsigned char map[MAXMSGLIMIT] = "";
> ---
> >       unsigned char map[MAXMSGLIMIT];
> 4440a4442
> >     memset (map, 0, sizeof(map)); //set the memory to 0 for Safety sake.
> 4458c4460
> <       for (x = 0; x < vmu->maxmsg; x++) {
> ---
> >       for (x = 0; x < MAXMSGLIMIT; x++) {
> {noformat}
> The important change is running the for cycle until MAXMSGLIMIT but as far as I know there's no guarantee that memory allocated in the stack is zeroed so that's why I also included the memset call.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list