From 259c8c51f3f618f127bc7f1146be2bf1c8f431bf Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 31 Mar 2018 16:39:13 +0200 Subject: [PATCH] Throw exception instead of printing to stderr and adding missing exit (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6954). --- MagickCore/draw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MagickCore/draw.c b/MagickCore/draw.c index bb5faf10a..3caca1e56 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -6021,8 +6021,12 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path, default: { if (isalpha((int) ((unsigned char) attribute)) != 0) - (void) FormatLocaleFile(stderr,"attribute not recognized: %c\n", - attribute); + { + (void) ThrowMagickException(exception,GetMagickModule(),DrawError, + "attribute not recognized","`%c'",attribute); + primitive_info->coordinates=0; + return(0); + } break; } } -- 2.40.0