<div dir="ltr"><div>HI<br><br></div>I'm getting a error building xorg-server-1.14.1.902 with thelatest snapshot of gcc-4.8:<br><br>kinput.c:225:43: error: array subscript is above array bounds [-Werror=array-bounds]<br clear="all">
<div><div><br></div><div>This is because kdNumInputFds can become equal to KD_MAX_INPUT_FDS in KdRegisterFd(). This means that in KdUnregisterFd(), kdInputFds[j + 1] can be beyond the end of the array.<br><br></div><div>The patch below fixes the error.<br>
<br></div><div>Signed-off-by: Chris Clayton <<a href="mailto:chris2553@googlemail.com">chris2553@googlemail.com</a>><br>---<br>--- xorg-server-1.14.1.902/hw/kdrive/src/kinput.c~ 2013-06-14 21:22:31.000000000 +0100<br>
+++ xorg-server-1.14.1.902/hw/kdrive/src/kinput.c 2013-06-14 21:47:21.000000000 +0100<br>@@ -221,7 +221,7 @@<br> if (do_close)<br> close(kdInputFds[i].fd);<br> kdNumInputFds--;<br>
- for (j = i; j < kdNumInputFds; j++)<br>+ for (j = i; j < (kdNumInputFds - 1); j++)<br> kdInputFds[j] = kdInputFds[j + 1];<br> break;<br> }<br></div><div>---<br>
<br></div></div></div>