]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18128
authorCristy <urban-warrior@imagemagick.org>
Thu, 17 Oct 2019 23:45:47 +0000 (19:45 -0400)
committerCristy <urban-warrior@imagemagick.org>
Thu, 17 Oct 2019 23:45:47 +0000 (19:45 -0400)
MagickCore/profile.c

index fed7a056e62f801d8cc3961a638e92c0baa407a2..12152281a8584daaf155e99c3ebafd83c258b267 100644 (file)
@@ -1722,31 +1722,15 @@ static MagickBooleanType ValidateXMPProfile(const StringInfo *profile)
   return(MagickTrue);
 }
 #else
-static unsigned char *FindNeedleInHaystack(unsigned char *haystack,
-  const char *needle)
-{
-  size_t
-    length;
-
-  unsigned char
-    *c;
-
-  length=strlen(needle);
-  for (c=haystack; *c != '\0'; c++)
-    if (LocaleNCompare((const char *) c,needle,length) == 0)
-      return(c);
-  return((unsigned char *) NULL);
-}
-
 static MagickBooleanType ValidateXMPProfile(const StringInfo *profile)
 {
-  unsigned char
+  char
     *p;
 
-  p=FindNeedleInHaystack(GetStringInfoDatum(profile),"x:xmpmeta");
-  if (p == (unsigned char *) NULL)
-    p=FindNeedleInHaystack(GetStringInfoDatum(profile),"rdf:RDF");
-  return(p == (unsigned char *) NULL ? MagickFalse : MagickTrue);
+  p=strcasestr((const char *) GetStringInfoDatum(profile),"x:xmpmeta");
+  if (p != (char *) NULL)
+    p=strcasestr((const char *) GetStringInfoDatum(profile),"rdf:RDF");
+  return(p == (char *) NULL ? MagickFalse : MagickTrue);
 }
 #endif