From 7719dc73254e4275956058db627d9b1a6857db4a Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 28 Sep 2018 10:45:16 +0200 Subject: [PATCH] RENDER: Fix check for convolution filter The X11 server's answer is not \0-terminated, so xcb_str_name() also does not provide a \0-terminated pointer. Signed-off-by: Uli Schlachter --- src/compton.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compton.c b/src/compton.c index 5c7e845..04eab3e 100644 --- a/src/compton.c +++ b/src/compton.c @@ -4740,7 +4740,8 @@ init_filters(session_t *ps) { xcb_str_iterator_t iter = xcb_render_query_filters_filters_iterator(pf); for (; iter.rem; xcb_str_next(&iter)) { // Convolution filter - if (!strcmp(xcb_str_name(iter.data), XRFILTER_CONVOLUTION)) + if (strlen(XRFILTER_CONVOLUTION) == xcb_str_name_length(iter.data) + && !memcmp(XRFILTER_CONVOLUTION, xcb_str_name(iter.data), strlen(XRFILTER_CONVOLUTION))) ps->xrfilter_convolution_exists = true; } free(pf);