check buffersize before reading next char, fixes the "mouse stuck at left"

bug (bugzilla #3113) for BSD systems using wscons. (Dale Rahn).
This commit is contained in:
Matthieu Herrb 2006-05-27 23:15:05 +00:00
parent 2102fdd0a5
commit c38aab293a
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2006-05-26 Matthieu Herrb <matthieu.herrb@laas.fr>
* hw/xfree86/os-support/bsd/bsd_mouse.c:
check buffersize before reading next char, fixes the
"mouse stuck at left" bug (bugzilla #3113) for BSD systems using
wscons. (Dale Rahn).
2006-05-25 Jeremy C. Reed <reed@reedmedia.net>
* doc/Xserver.man.pre:

View File

@ -401,7 +401,7 @@ wsconsReadInput(InputInfoPtr pInfo)
XisbBlockDuration(pMse->buffer, -1);
pBuf = (unsigned char *)eventList;
n = 0;
while ((c = XisbRead(pMse->buffer)) >= 0 && n < sizeof(eventList)) {
while (n < sizeof(eventList) && (c = XisbRead(pMse->buffer)) >= 0) {
pBuf[n++] = (unsigned char)c;
}