dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: dri-devel@lists.freedesktop.org
Cc: Ezequiel Garcia <ezequiel@collabora.com>,
	rohan.garg@collabora.com, Emil Velikov <emil.l.velikov@gmail.com>
Subject: [PATCH libdrm 1/2] modetest: Fix segmentation fault
Date: Mon, 22 Jul 2019 13:08:22 -0300	[thread overview]
Message-ID: <20190722160823.26668-1-ezequiel@collabora.com> (raw)

When a mode is set with just a connector "-s foo",
we get a nasty segmentation fault. Fix it.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 tests/modetest/modetest.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index e66be6607e00..5e628127a130 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -1695,6 +1695,8 @@ static int parse_connector(struct pipe_arg *pipe, const char *arg)
 		return -1;
 
 	/* Parse the remaining parameters. */
+	if (!endp)
+		return -1;
 	if (*endp == '@') {
 		arg = endp + 1;
 		pipe->crtc_id = strtoul(arg, &endp, 10);
-- 
2.22.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-07-22 16:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 16:08 Ezequiel Garcia [this message]
2019-07-22 16:08 ` [PATCH libdrm 2/2] modetest: Add a new "-r" option to set a default mode Ezequiel Garcia
2019-07-24 10:43   ` Rohan Garg
2020-01-21 18:30   ` Emil Velikov
2019-08-15 12:07 ` [PATCH libdrm 1/2] modetest: Fix segmentation fault Ezequiel Garcia
2019-09-18 22:08   ` Ezequiel Garcia
2020-01-20 18:35 ` Ezequiel Garcia

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=20190722160823.26668-1-ezequiel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=rohan.garg@collabora.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox