uchicago-cs/chitcp — pull request #1 by theseoafs (2014-02-16 07:10:09+00:00)
Title: Changed circular_buffer_read and circular_buffer_peek functions to trans...

...fer bytes from the circular buffer to the destination buffer rather than the maximum allowable length . This prevents a buffer overflow error.

Notice that these functons compute a `toread` variable (which is supposed to represent the number of bytes read from the circular buffer), but this value isn't actually used. Instead, `len` is passed as the length argument to `memcpy` -- this seems to be a typo.