From c613b006cf2df5783315f0499b9d628a44c8b9e7 Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 15 Oct 2019 19:31:34 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18265 --- MagickCore/color.c | 6 +++--- MagickCore/nt-base.h | 3 +++ coders/ps.c | 6 +++--- config/config.h.in | 3 +++ configure | 4 ++-- configure.ac | 2 +- utilities/montage.1 | 2 ++ 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/MagickCore/color.c b/MagickCore/color.c index 24b707cf0..227611b60 100644 --- a/MagickCore/color.c +++ b/MagickCore/color.c @@ -2142,11 +2142,11 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *cache,const char *xml, compliance; compliance=color_info->compliance; - if (GlobExpression(token,"*SVG*",MagickTrue) != MagickFalse) + if (strcasestr(token,"SVG") != (char *) NULL) compliance|=SVGCompliance; - if (GlobExpression(token,"*X11*",MagickTrue) != MagickFalse) + if (strcasestr(token,"X11") != (char *) NULL) compliance|=X11Compliance; - if (GlobExpression(token,"*XPM*",MagickTrue) != MagickFalse) + if (strcasestr(token,"XPM") != (char *) NULL) compliance|=XPMCompliance; color_info->compliance=(ComplianceType) compliance; break; diff --git a/MagickCore/nt-base.h b/MagickCore/nt-base.h index fc2314de0..139ccdfae 100644 --- a/MagickCore/nt-base.h +++ b/MagickCore/nt-base.h @@ -244,6 +244,9 @@ extern "C" { #if !defined(strcasecmp) # define strcasecmp _stricmp #endif +#if !defined(strcasestr) +# define strcasestr StrStrIA +#endif #if !defined(strncasecmp) # define strncasecmp _strnicmp #endif diff --git a/coders/ps.c b/coders/ps.c index 50aef44eb..af69804c2 100644 --- a/coders/ps.c +++ b/coders/ps.c @@ -340,9 +340,9 @@ static void ReadPSInfo(const ImageInfo *image_info,Image *image, if (CompareMagickByteBuffer(&buffer,DocumentProcessColors,length) != MagickFalse) { p=GetMagickByteBufferDatum(&buffer); - if ((GlobExpression(p,"*Cyan*",MagickTrue) != MagickFalse) || - (GlobExpression(p,"*Magenta*",MagickTrue) != MagickFalse) || - (GlobExpression(p,"*Yellow*",MagickTrue) != MagickFalse)) + if ((strcasestr(p,"Cyan") != (char *) NULL) || + (strcasestr(p,"Magenta") != (char *) NULL) || + (strcasestr(p,"Yellow") != (char *) NULL)) ps_info->cmyk=MagickTrue; } if (CompareMagickByteBuffer(&buffer,CMYKCustomColor,strlen(CMYKCustomColor)) != MagickFalse) diff --git a/config/config.h.in b/config/config.h.in index 42538eb0a..4f15dbede 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -456,6 +456,9 @@ /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP +/* Define to 1 if you have the `strcasestr' function. */ +#undef HAVE_STRCASESTR + /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR diff --git a/configure b/configure index 961ab5391..f043bc610 100755 --- a/configure +++ b/configure @@ -4581,7 +4581,7 @@ MAGICK_PATCHLEVEL_VERSION=69 MAGICK_VERSION=7.0.8-69 -MAGICK_GIT_REVISION=16183:d158c5c7f:20191012 +MAGICK_GIT_REVISION=16237:a9b81c8d5:20191015 # Substitute library versioning @@ -34103,7 +34103,7 @@ fi # Check for functions # -for ac_func in acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock clock_getres clock_gettime ctime_r directio erf _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink realpath select seekdir sendfile setlocale socket sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat +for ac_func in acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock clock_getres clock_gettime ctime_r directio erf _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink realpath select seekdir sendfile setlocale socket sqrt setvbuf stat strcasestr strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.ac b/configure.ac index 89a777c40..65492adc3 100644 --- a/configure.ac +++ b/configure.ac @@ -3052,7 +3052,7 @@ dnl =========================================================================== # Check for functions # -AC_CHECK_FUNCS([acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock clock_getres clock_gettime ctime_r directio erf _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink realpath select seekdir sendfile setlocale socket sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat]) +AC_CHECK_FUNCS([acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock clock_getres clock_gettime ctime_r directio erf _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink realpath select seekdir sendfile setlocale socket sqrt setvbuf stat strcasestr strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat]) # Substitute compiler name to build/link PerlMagick # diff --git a/utilities/montage.1 b/utilities/montage.1 index 3abb4e0e6..54c2309e5 100644 --- a/utilities/montage.1 +++ b/utilities/montage.1 @@ -25,6 +25,7 @@ Image Settings: \-compress type type of pixel compression when writing the image \-define format:option define one or more image format options + \-delay value display the next image after pausing \-density geometry horizontal and vertical density of the image \-depth value image depth \-display server query font from this X server @@ -102,6 +103,7 @@ Image Operators: \-flip flip image in the vertical direction \-flop flop image in the horizontal direction \-frame geometry surround image with an ornamental border + \-layers method optimize or compare image layers \-monochrome transform image to black and white \-polaroid angle simulate a Polaroid picture \-resize geometry resize the image -- 2.40.0