From 5a8f3121c7f64dbb47fad99c027389e7d78453e4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 13 Sep 2018 09:39:22 +1000 Subject: [PATCH] test-xi2: add an extra NULL-check Shuts up coverity because it doesn't know that by the time we get here, we're guaranteed that the device exists. Otherwise the list() call a few lines above would've failed and we wouldn't get here. Signed-off-by: Peter Hutterer --- src/test_xi2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test_xi2.c b/src/test_xi2.c index 402acac..10a46c3 100644 --- a/src/test_xi2.c +++ b/src/test_xi2.c @@ -358,6 +358,10 @@ test_xi2(Display *display, if (argc >= 1) { XIDeviceInfo *info; info = xi2_find_device_info(display, argv[0]); + /* info is alway valid, the list() call exits if the device + cannot be found, but let's shut up coverity */ + if (!info) + return EXIT_FAILURE; deviceid = info->deviceid; } -- 2.56.0