Fix buffer overflow in git diff