]> granicus.if.org Git - imagemagick/commitdiff
Fix undefined behavior when calling isdigit (#989)
authorRoland Illig <roland.illig@gmx.de>
Sun, 18 Feb 2018 23:48:47 +0000 (00:48 +0100)
committerImageMagick <urban-warrior@users.noreply.github.com>
Sun, 18 Feb 2018 23:48:47 +0000 (18:48 -0500)
MagickCore/property.c

index 5ad1110b3d5bd95a57f2667aa05da96c8b845f06..2841c06225d5b22b7a5289379ab86fccb88206af 100644 (file)
@@ -3396,7 +3396,7 @@ RestoreMSCWarning
   interpret_text=AcquireString(embed_text); /* new string with extra space */
   extent=MagickPathExtent;                     /* allocated space in string */
   number=MagickFalse;                       /* is last char a number? */
-  for (q=interpret_text; *p!='\0'; number=isdigit(*p) ? MagickTrue : MagickFalse,p++)
+  for (q=interpret_text; *p!='\0'; number=isdigit((int) ((unsigned char) *p)) ? MagickTrue : MagickFalse,p++)
   {
     /*
       Look for the various escapes, (and handle other specials)