diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index a24fce37b..fd83022f6 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -119,7 +119,7 @@ hwEnableIO(void) short i; size_t n=0; int begin, end; - char *buf=NULL, target[4]; + char *buf=NULL, target[5]; FILE *fp; if (ioperm(0, 1024, 1)) { @@ -129,6 +129,8 @@ hwEnableIO(void) } #if !defined(__alpha__) + target[4] = '\0'; + /* trap access to the keyboard controller(s) and timer chip(s) */ fp = fopen("/proc/ioports", "r"); while (getline(&buf, &n, fp) != -1) {