From: Zbyněk Moravec Date: Fri, 2 Dec 2016 17:53:59 +0000 (+0100) Subject: Fix read of uninitialized memory (#2596) X-Git-Tag: 4.14~83 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=05a2270eb7aff19b060ebac7830a29c5278b7cc6;p=i3%2Fi3 Fix read of uninitialized memory (#2596) Previous code was reading whole array, it was slower and it read uninitialized memory --- diff --git a/src/bindings.c b/src/bindings.c index eec821b6..c76e7779 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -981,7 +981,7 @@ int *bindings_get_buttons_to_grab(void) { } /* Avoid duplicates. */ - for (int i = 0; i < num_max; i++) { + for (int i = 0; i < num; i++) { if (buffer[i] == button) continue; }