1
0

- u_kdrive-UnregisterFd-Fix-off-by-one.patch

* Copy open file table correctly by avoiding an off-by-one error
  (boo#867483).

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=594
This commit is contained in:
Egbert Eich 2015-11-25 10:34:21 +00:00 committed by Git OBS Bridge
parent 220bffcd27
commit 507ed0d0a1
3 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,29 @@
From: Egbert Eich <eich@suse.de>
Date: Tue Nov 24 16:10:08 2015 +0100
Subject: [PATCH]kdrive/UnregisterFd: Fix off by one
Patch-mainline: to be upstreamed
References: boo#867483
Signed-off-by: Egbert Eich <eich@suse.com>
The number of FDs has been decremented already, therefore this
number contains the index of the top one that is to me moved down.
Signed-off-by: Egbert Eich <eich@suse.de>
---
hw/kdrive/src/kinput.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index a539ca5..d28bbe0 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -221,7 +221,7 @@ KdUnregisterFd(void *closure, int fd, Bool do_close)
if (do_close)
close(kdInputFds[i].fd);
kdNumInputFds--;
- for (j = i; j < (kdNumInputFds - 1); j++)
+ for (j = i; j < kdNumInputFds; j++)
kdInputFds[j] = kdInputFds[j + 1];
break;
}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Nov 25 10:31:51 UTC 2015 - eich@suse.com
- u_kdrive-UnregisterFd-Fix-off-by-one.patch
* Copy open file table correctly by avoiding an off-by-one error
(boo#867483).
-------------------------------------------------------------------
Tue Nov 10 13:42:47 UTC 2015 - sndirsch@suse.com

View File

@ -181,6 +181,7 @@ Patch117: xorg-x11-server-byte-order.patch
Patch160: u_vesa-Add-VBEDPMSGetCapabilities-VBEDPMSGet.patch
Patch204: U_systemd-logind-do-not-rely-on-directed-signals.patch
Patch205: u_kdrive-UnregisterFd-Fix-off-by-one.patch
Patch1000: n_xserver-optimus-autoconfig-hack.patch
@ -274,6 +275,7 @@ cp %{SOURCE90} .
%patch160 -p1
%patch204 -p1
%patch205 -p1
%patch1000 -p1