xorg-server-1.14.1.902 - build error
Chris Clayton
chris2553 at googlemail.com
Fri Jun 14 14:35:07 PDT 2013
HI
I'm getting a error building xorg-server-1.14.1.902 with thelatest snapshot
of gcc-4.8:
kinput.c:225:43: error: array subscript is above array bounds
[-Werror=array-bounds]
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.
The patch below fixes the error.
Signed-off-by: Chris Clayton <chris2553 at googlemail.com>
---
--- xorg-server-1.14.1.902/hw/kdrive/src/kinput.c~ 2013-06-14
21:22:31.000000000 +0100
+++ xorg-server-1.14.1.902/hw/kdrive/src/kinput.c 2013-06-14
21:47:21.000000000 +0100
@@ -221,7 +221,7 @@
if (do_close)
close(kdInputFds[i].fd);
kdNumInputFds--;
- for (j = i; j < kdNumInputFds; j++)
+ for (j = i; j < (kdNumInputFds - 1); j++)
kdInputFds[j] = kdInputFds[j + 1];
break;
}
---
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20130614/a5abd194/attachment.html>
More information about the xorg-devel
mailing list