Fix potential overflow in mpp_err_msg_cache()
Saving the error message into the static buffer can lead to overflow since the string copy isn't bounded. Move to using a bounded copy and also indicate truncated messages by ending them with ".." Considering that this doesn't seem to have happened indicates that it's not worth dynamically extending/shrinking the buffer to cope with the input, simply ensuring to not overflow is probably enough.
Showing
想要评论请 注册 或 登录