nouveau/ws: bound check nouveau_ws_push_append

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Karol Herbst 2022-08-20 18:54:32 +02:00 committed by Marge Bot
parent 6f702f9939
commit c791fae67b

View file

@ -94,6 +94,9 @@ nouveau_ws_push_append(struct nouveau_ws_push *push,
assert(other->bos.size == 0);
size_t count = other->map - other->orig_map;
assert(push->map + count <= push->end);
memcpy(push->map, other->orig_map, count * sizeof(*push->map));
push->map += count;
push->last_size = NULL;