c
<       memmove (buf, buf + start, initial_read - start)
---
>       if (start < bufsize && initial_read - start >= 0)
>       {
>           memmove (buf, buf + start, initial_read - start);
>       }
