Memory corruption when size of buffer from previous call is used without validation or re-initialization.