diff options
author | Ezequiel Garcia <ezequiel@collabora.com> | 2019-07-22 13:08:22 -0300 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2020-01-21 17:56:23 +0000 |
commit | 07d48a4c00ac7944ee066384121e2a00d2b94e30 (patch) | |
tree | f4f00dff0485331d2a44c9c0c9852635e1dab7b6 | |
parent | 899da0f486f19f5f56f2f97e93e948a6ec10f789 (diff) | |
download | external_libdrm-07d48a4c00ac7944ee066384121e2a00d2b94e30.tar.gz external_libdrm-07d48a4c00ac7944ee066384121e2a00d2b94e30.tar.bz2 external_libdrm-07d48a4c00ac7944ee066384121e2a00d2b94e30.zip |
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 <ezequiel@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
-rw-r--r-- | tests/modetest/modetest.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |