From 08794028f9bf4ccbe371afb7af971cd497129e90 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Wed, 30 Apr 2008 16:38:42 -0300 Subject: [PATCH] Fix an off by one read error in drmSIGIOHandler(). --- hw/xfree86/dri/dri.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 80e07c5..2b4e5f8 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -2491,7 +2491,7 @@ static void drmSIGIOHandler(int interrupt, void *closure) #if 0 fprintf(stderr, "Trying %d\n", entry->fd); #endif - if ((count = read(entry->fd, buf, sizeof(buf))) > 0) { + if ((count = read(entry->fd, buf, sizeof(buf) - 1)) > 0) { buf[count] = '\0'; #if 0 fprintf(stderr, "Got %s\n", buf); -- 1.5.4.3