[asterisk-dev] [Code Review] 3599: menuselect fails to read config when all resource modules are disabled

Matt Jordan reviewboard at asterisk.org
Fri Jun 6 21:41:35 CDT 2014


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



/trunk/menuselect.c
<https://reviewboard.asterisk.org/r/3599/#comment22109>

    As much as I'd like to hit 'Ship It!', I'm pretty sure this is going blow up people trying to use menuselect on embedded systems.
    
    8k is a pretty big stack allocation...
    
    We're using fgets here to parse out the file - what line length is exceeding 2k in that file? 
    
    Another option here would be to allocate a buffer on the heap, read chunks in 2k sizes, add the contents to the buffer, and grow + add until we've read a full line.
    


- Matt Jordan


On June 6, 2014, 1:59 p.m., Corey Farrell wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3599/
> -----------------------------------------------------------
> 
> (Updated June 6, 2014, 1:59 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-23830
>     https://issues.asterisk.org/jira/browse/ASTERISK-23830
> 
> 
> Repository: Menuselect
> 
> 
> Description
> -------
> 
> menuselect reads config using a char buf[2048].  This is too small if all resource modules are disabled - causing the last modules listed to be re-enabled.  This change expands the buffer to 8192.
> 
> 
> Diffs
> -----
> 
>   /trunk/menuselect.c 1157 
> 
> Diff: https://reviewboard.asterisk.org/r/3599/diff/
> 
> 
> Testing
> -------
> 
> make menuselect, disabled all resource modules, saved and went back in to verify all resource modules were still disabled.
> 
> 
> Thanks,
> 
> Corey Farrell
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140607/dd9186cc/attachment.html>


More information about the asterisk-dev mailing list