Overflow #7

wants to merge 2 commits into
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() ->
            S = lists:duplicate(8192*1024*2, "x"),
    Fix the problem by putting the data on the heap.