From: Daniel Stone <daniels@collabora.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH libdrm] drm/atomic: Refuse to add invalid objects to requests
Date: Wed, 7 Mar 2018 12:42:15 +0000 [thread overview]
Message-ID: <20180307124215.16107-1-daniels@collabora.com> (raw)
Object and property IDs cannot be zero. Prevent them from being added to
the request stream at all, rather than breaking at commit time.
Signed-off-by: Daniel Stone <daniels@collabora.com>
---
xf86drmMode.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/xf86drmMode.c b/xf86drmMode.c
index 15957ffc..bd59ef25 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -1313,6 +1313,9 @@ int drmModeAtomicAddProperty(drmModeAtomicReqPtr req,
if (!req)
return -EINVAL;
+ if (object_id == 0 || property_id == 0)
+ return -EINVAL;
+
if (req->cursor >= req->size_items) {
drmModeAtomicReqItemPtr new;
--
2.14.3
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2018-03-07 12:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 12:42 Daniel Stone [this message]
2018-03-07 16:42 ` [PATCH libdrm] drm/atomic: Refuse to add invalid objects to requests Daniel Vetter
2018-03-07 17:20 ` Daniel Stone
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180307124215.16107-1-daniels@collabora.com \
--to=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.