From 63434c1d59a91f3494bf66a92d8ecc95f5132156 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 21 Apr 2018 11:43:43 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7872 --- MagickCore/fx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MagickCore/fx.c b/MagickCore/fx.c index 28b4f255b..99ef1f746 100644 --- a/MagickCore/fx.c +++ b/MagickCore/fx.c @@ -2547,7 +2547,10 @@ static double FxEvaluateSubexpression(FxInfo *fx_info, case AlphaPixelChannel: type="opacity"; break; default: type="unknown"; break; } - (void) CopyMagickString(subexpression,expression+6,MagickPathExtent); + *subexpression='\0'; + if (strlen(expression) > 6) + (void) CopyMagickString(subexpression,expression+6, + MagickPathExtent); if (strlen(subexpression) > 1) subexpression[strlen(subexpression)-1]='\0'; if (fx_info->file != (FILE *) NULL) -- 2.40.0