Changeset 786

Show
Ignore:
Timestamp:
06/23/08 04:05:18 (5 months ago)
Author:
dormando
Message:

Fix heap corruption when copying too much data onto an item.

(Dustin:)
I wrote a fuzz test that would consistently crash in assoc_find, but
after this change the test failed to break things and my fuzz
generator couldn't produce another breaking case.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/server/memcached.c

    r784 r786  
    15281528        } 
    15291529        memcpy(ITEM_data(new_it), buf, res); 
    1530         memcpy(ITEM_data(new_it) + res, "\r\n", 3); 
     1530        memcpy(ITEM_data(new_it) + res, "\r\n", 2); 
    15311531        do_item_replace(it, new_it); 
    15321532        do_item_remove(new_it);       /* release our reference */