From: Michael Stapelberg Date: Thu, 3 Mar 2011 13:14:35 +0000 (+0100) Subject: fix invalid memory access in xcb_reply_contains_atom (Thanks ys) X-Git-Tag: tree-pr2~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=62362a464d729938024f5451d6f413414b496340;p=i3%2Fi3 fix invalid memory access in xcb_reply_contains_atom (Thanks ys) --- 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;