Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/i915/gvt: Use snprintf() to prevent possible buffer overflow.
For printing the intel_vgpu->id, a buffer with fixed length is allocated on the stack. But if vgpu->id is greater than 6 characters, the buffer overflow will happen. Even the string of the amount of max vgpu is less that the length buffer right now, it's better to replace sprintf() with snprintf(). v2: - Increase the size of the buffer. (Colin Xu) This patch fixed the critical issue torvalds#673 reported by klocwork. Signed-off-by: Aleksei Gimbitskii <[email protected]> Cc: Zhenyu Wang <[email protected]> Cc: Zhi Wang <[email protected]> Cc: Colin Xu <[email protected]> Reviewed-by: Colin Xu <[email protected]> Signed-off-by: Zhenyu Wang <[email protected]>
- Loading branch information