[PATCH xf86-video-nested 05/10] Fix an "array index out of bounds" error in _nested_input_init_buttons().

Laércio de Sousa laerciosousa at sme-mogidascruzes.sp.gov.br
Thu Nov 5 01:15:01 PST 2015


Signed-off-by: Laércio de Sousa <laerciosousa at sme-mogidascruzes.sp.gov.br>
---
 src/nested_input.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/nested_input.c b/src/nested_input.c
index 9d2e0d3..0d584c8 100644
--- a/src/nested_input.c
+++ b/src/nested_input.c
@@ -27,6 +27,7 @@
  * Colin Hill <colin.james.hill at gmail.com>
  * Weseung Hwang <weseung at gmail.com>
  * Nathaniel Way <nathanielcw at hotmail.com>
+ * Laércio de Sousa <laerciosousa at sme-mogidascruzes.sp.gov.br>
  */
 
 #include <errno.h>
@@ -192,7 +193,7 @@ _nested_input_init_buttons(DeviceIntPtr device) {
     CARD8       *map;
     Atom         buttonLabels[NUM_MOUSE_BUTTONS] = {0};
 
-    map = calloc(NUM_MOUSE_BUTTONS, sizeof(CARD8));
+    map = calloc(NUM_MOUSE_BUTTONS + 1, sizeof(CARD8));
 
     int i;
     for (i = 0; i < NUM_MOUSE_BUTTONS; i++)
-- 
2.1.4



More information about the xorg-devel mailing list