[asterisk-dev] [Code Review]: Correct message array allocation issues in app_voicemail

opticron reviewboard at asterisk.org
Wed Jun 20 15:18:12 CDT 2012



> On June 20, 2012, 9:32 a.m., Mark Michelson wrote:
> > branches/1.8/apps/app_voicemail.c, lines 1768-1769
> > <https://reviewboard.asterisk.org/r/1994/diff/1/?file=28969#file28969line1768>
> >
> >     You should probably put this inside the if block above. It doesn't hurt to have it here, but it makes more sense in the if block.

Addressed a little differently.


> On June 20, 2012, 9:32 a.m., Mark Michelson wrote:
> > branches/1.8/apps/app_voicemail.c, lines 8048-8056
> > <https://reviewboard.asterisk.org/r/1994/diff/1/?file=28969#file28969line8048>
> >
> >     This is an area where I think you might run into an issue, but only if IMAP storage is in use.
> >     
> >     With ODBC and file storage, vm_state variables are always local variables, and so synchronization across threads is not an issue to consider.
> >     
> >     With IMAP, on the other hand, the vm_state that you are operating on may be local to the stack, thread-local, or it could be a pointing to a persistent vm_state in a global list. That being said, here in close_mailbox(), this modification of vms->dh_arraysize (as well as its access earlier in the function) is not protected by a lock. The result is that you could end up with badness due to competing threads mucking around with the data. The modifications/accesses of vms->dh_arraysize in open_mailbox() and vm_allocate_dh() are lock-protected.

Done.


- opticron


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1994/#review6513
-----------------------------------------------------------


On June 20, 2012, 8:18 a.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1994/
> -----------------------------------------------------------
> 
> (Updated June 20, 2012, 8:18 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch reworks the handling of array allocation and freeing to ensure that freed memory is not used.
> 
> 
> This addresses bug AST-894.
>     https://issues.asterisk.org/jira/browse/AST-894
> 
> 
> Diffs
> -----
> 
>   branches/1.8/apps/app_voicemail.c 368806 
> 
> Diff: https://reviewboard.asterisk.org/r/1994/diff
> 
> 
> Testing
> -------
> 
> Poked through voicemail manually.  Testing has been performed on issue ASTERISK-19923 and seems to have corrected the segfault in that case.
> 
> 
> Thanks,
> 
> opticron
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120620/d26ff598/attachment.htm>


More information about the asterisk-dev mailing list