Commit 48b1af27 authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Adam Jackson

modesetting: fix conn_id termination and potential overrun by 1 byte

Noticed when porting this logic to xf86-video-nouveau, and valgrind
complained about conditional jump based on uninitialized data.
Signed-off-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
parent 899d2607
......@@ -2840,7 +2840,7 @@ static int parse_path_blob(drmModePropertyBlobPtr path_blob, int *conn_base_id,
if (len + 1> 5)
return -1;
memcpy(conn_id, blob_data + 4, len);
conn_id[len + 1] = '\0';
conn_id[len] = '\0';
id = strtoul(conn_id, NULL, 10);
*conn_base_id = id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment