From 07d48a4c00ac7944ee066384121e2a00d2b94e30 Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Mon, 22 Jul 2019 13:08:22 -0300 Subject: [PATCH] modetest: Fix segmentation fault When a mode is set with just a connector "-s foo", we get a nasty segmentation fault. Fix it. Signed-off-by: Ezequiel Garcia Reviewed-by: Emil Velikov --- tests/modetest/modetest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 24436976..09fd5651 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -1721,6 +1721,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.11.0