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

Mark Michelson reviewboard at asterisk.org
Wed Jun 20 09:32:37 CDT 2012


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



branches/1.8/apps/app_voicemail.c
<https://reviewboard.asterisk.org/r/1994/#comment12289>

    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.



branches/1.8/apps/app_voicemail.c
<https://reviewboard.asterisk.org/r/1994/#comment12290>

    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.


- Mark


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/c5a2495e/attachment.htm>


More information about the asterisk-dev mailing list