From 5c8f4784b916c0077cda3975851e3dbbabe22451 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 20 Nov 2009 13:41:37 +0000 Subject: Make sure no data out of the buffer is logged. --- xorg-server/os/log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index 01bc4fe53..c0fdb5703 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -271,7 +271,8 @@ LogVWrite(int verb, const char *f, va_list args) * stream(s). */ if (verb < 0 || logFileVerbosity >= verb || logVerbosity >= verb) { - vsnprintf(tmpBuffer, sizeof(tmpBuffer), f, args); + vsnprintf(tmpBuffer, sizeof(tmpBuffer)-1, f, args); + tmpBuffer[sizeof(tmpBuffer)-1]=0; len = strlen(tmpBuffer); } if ((verb < 0 || logVerbosity >= verb) && len > 0) -- cgit v1.2.3