]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Mon, 19 Nov 2018 20:21:39 +0000 (15:21 -0500)
committerCristy <urban-warrior@imagemagick.org>
Mon, 19 Nov 2018 20:21:52 +0000 (15:21 -0500)
coders/tiff.c

index 31f36b7e8b48e4c88a95e5e6fac2938ce3b71812..b0196f581c77f3fd200e3731aee858740c6f86ef 100644 (file)
@@ -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)