Overflow #7

Open
wants to merge 2 commits into
from
Commits on Apr 28, 2012
  1. @msantos

    Fix buffer overflow

    msantos committed Apr 28, 2012
    Increase the buffer size for strings by one byte to accomodate the
    trail NULL expected by ei_decode_string:
    
        The string is copied to p, and enough space must be allocated. The
        returned string is null terminated so you need to add an extra byte
        to the memory requirement.
  2. @msantos

    Prevent stack overflow

    msantos committed Apr 28, 2012
    Large strings can overflow the stack:
    
        crash() ->
            cecho:start(0,0),
            S = lists:duplicate(8192*1024*2, "x"),
            cecho:mvaddstr(0,0,S).
    
    Fix the problem by putting the data on the heap.