From 4e906a4c9520803321a39d76b29fca5cf3fcdd0b Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 19 Nov 2018 15:21:39 -0500 Subject: [PATCH] ... --- coders/tiff.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coders/tiff.c b/coders/tiff.c index 31f36b7e8..b0196f581 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -647,10 +647,11 @@ static void TIFFErrors(const char *module,const char *format,va_list error) *exception; #if defined(MAGICKCORE_HAVE_VSNPRINTF) - (void) vsnprintf(message,MagickPathExtent,format,error); + (void) vsnprintf(message,MagickPathExtent-2,format,error); #else (void) vsprintf(message,format,error); #endif + message[MaxTextExtent-2]='\0'; (void) ConcatenateMagickString(message,".",MagickPathExtent); exception=(ExceptionInfo *) GetMagickThreadValue(tiff_exception); if (exception != (ExceptionInfo *) NULL) @@ -995,10 +996,11 @@ static void TIFFWarnings(const char *module,const char *format,va_list warning) *exception; #if defined(MAGICKCORE_HAVE_VSNPRINTF) - (void) vsnprintf(message,MagickPathExtent,format,warning); + (void) vsnprintf(message,MagickPathExtent-2,format,warning); #else (void) vsprintf(message,format,warning); #endif + message[MaxTextExtent-2]='\0'; (void) ConcatenateMagickString(message,".",MagickPathExtent); exception=(ExceptionInfo *) GetMagickThreadValue(tiff_exception); if (exception != (ExceptionInfo *) NULL) -- 2.49.0