From 62362a464d729938024f5451d6f413414b496340 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 3 Mar 2011 14:14:35 +0100 Subject: [PATCH] fix invalid memory access in xcb_reply_contains_atom (Thanks ys) --- src/xcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xcb.c b/src/xcb.c index 53a90685..d2aeaadd 100644 --- a/src/xcb.c +++ b/src/xcb.c @@ -347,7 +347,7 @@ bool xcb_reply_contains_atom(xcb_get_property_reply_t *prop, xcb_atom_t atom) { if ((atoms = xcb_get_property_value(prop)) == NULL) return false; - for (int i = 0; i < xcb_get_property_value_length(prop); i++) + for (int i = 0; i < xcb_get_property_value_length(prop) / (prop->format / 8); i++) if (atoms[i] == atom) return true; -- 2.39.5