virgl: Array cmdline on stack should initialized to 0
Because strncpy may not append 0 if source string is longer than num(63)
Fixes: b3b82fe8ea ("virgl/vtest: add vtest driver")
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21034>
This commit is contained in:
@@ -119,7 +119,7 @@ static int virgl_vtest_send_init(struct virgl_vtest_winsys *vws)
|
||||
{
|
||||
uint32_t buf[VTEST_HDR_SIZE];
|
||||
const char *nstr = "virtest";
|
||||
char cmdline[64];
|
||||
char cmdline[64] = { 0 };
|
||||
int ret;
|
||||
|
||||
ret = os_get_process_name(cmdline, 63);
|
||||
|
||||
Reference in New Issue
Block a user