From bc358da30793396bfa2570730d9cb59bc659a8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 19 Jan 2016 17:45:04 +0100 Subject: [PATCH] decode: prevent handle 0 object creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau --- src/vrend_decode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vrend_decode.c b/src/vrend_decode.c index 1d1b2a2..b3c7dea 100644 --- a/src/vrend_decode.c +++ b/src/vrend_decode.c @@ -624,6 +624,8 @@ static int vrend_decode_create_object(struct vrend_decode_ctx *ctx, int length) if (length < 1) return EINVAL; + if (handle == 0) + return EINVAL; switch (obj_type){ case VIRGL_OBJECT_BLEND: