xorg-server-1.14.1.902 - build error

Chris Clayton chris2553 at googlemail.com
Thu Jun 20 11:31:03 PDT 2013



On 06/14/13 22:35, Chris Clayton wrote:
> 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.
>

As an update, I've been running xorg-server-1.14.1.902 with the patch 
below applied for almost a week now with no adverse effects.

Chris
> Signed-off-by: Chris Clayton <chris2553 at googlemail.com
> <mailto: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;
>           }
> ---
>


More information about the xorg-devel mailing list