]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Tue, 20 Mar 2018 11:24:08 +0000 (07:24 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 20 Mar 2018 11:24:08 +0000 (07:24 -0400)
coders/xpm.c

index d710287f70ea90ade35396036713302c31ef5d77..570cc3dbc11e22f447bb7e35ab96246f166e443a 100644 (file)
@@ -779,7 +779,7 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info,
   (void) WriteBlobString(image,"/* XPM */\n");
   GetPathComponent(picon->filename,BasePath,basename);
   (void) FormatLocaleString(buffer,MagickPathExtent,
-    "static char *%s[] = {\n",basename);
+    "static char *%.1024s[] = {\n",basename);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"/* columns rows colors chars-per-pixel */\n");
   (void) FormatLocaleString(buffer,MagickPathExtent,
@@ -813,8 +813,8 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info,
       symbol[j]=Cixel[k];
     }
     symbol[j]='\0';
-    (void) FormatLocaleString(buffer,MagickPathExtent,"\"%s c %s\",\n",
-       symbol,name);
+    (void) FormatLocaleString(buffer,MagickPathExtent,
+      "\"%.1024s c %.1024s\",\n",symbol,name);
     (void) WriteBlobString(image,buffer);
   }
   /*
@@ -841,7 +841,7 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info,
       (void) WriteBlobString(image,buffer);
       p+=GetPixelChannels(picon);
     }
-    (void) FormatLocaleString(buffer,MagickPathExtent,"\"%s\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"\"%.1024s\n",
       y == (ssize_t) (picon->rows-1) ? "" : ",");
     (void) WriteBlobString(image,buffer);
     status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
@@ -1006,7 +1006,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image,
   GetPathComponent(image->filename,BasePath,basename);
   if (isalnum((int) ((unsigned char) *basename)) == 0)
     {
-      (void) FormatLocaleString(buffer,MagickPathExtent,"xpm_%s",basename);
+      (void) FormatLocaleString(buffer,MagickPathExtent,"xpm_%.1024s",basename);
       (void) CopyMagickString(basename,buffer,MagickPathExtent);
     }
   if (isalpha((int) ((unsigned char) basename[0])) == 0)
@@ -1015,7 +1015,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image,
     if (isalnum((int) ((unsigned char) basename[i])) == 0)
       basename[i]='_';
   (void) FormatLocaleString(buffer,MagickPathExtent,
-    "static char *%s[] = {\n",basename);
+    "static char *%.1024s[] = {\n",basename);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"/* columns rows colors chars-per-pixel */\n");
   (void) FormatLocaleString(buffer,MagickPathExtent,
@@ -1046,8 +1046,8 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image,
       symbol[j]=Cixel[k];
     }
     symbol[j]='\0';
-    (void) FormatLocaleString(buffer,MagickPathExtent,"\"%s c %s\",\n",symbol,
-      name);
+    (void) FormatLocaleString(buffer,MagickPathExtent,
+      "\"%.1024s c %.1024s\",\n",symbol,name);
     (void) WriteBlobString(image,buffer);
   }
   /*
@@ -1074,7 +1074,7 @@ static MagickBooleanType WriteXPMImage(const ImageInfo *image_info,Image *image,
       (void) WriteBlobString(image,buffer);
       p+=GetPixelChannels(image);
     }
-    (void) FormatLocaleString(buffer,MagickPathExtent,"\"%s\n",
+    (void) FormatLocaleString(buffer,MagickPathExtent,"\"%.1024s\n",
       (y == (ssize_t) (image->rows-1) ? "" : ","));
     (void) WriteBlobString(image,buffer);
     if (image->previous == (Image *) NULL)