From: Cristy Date: Sat, 25 Aug 2018 00:59:00 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-11~43 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=777e314540d93afb5c6f831afceb35585de67106;p=imagemagick ... --- diff --git a/MagickCore/static.c b/MagickCore/static.c index fafa106ab..14cf7c066 100644 --- a/MagickCore/static.c +++ b/MagickCore/static.c @@ -378,6 +378,9 @@ MagickExport MagickBooleanType RegisterStaticModule(const char *module, char module_name[MagickPathExtent]; + PolicyRights + rights; + register const CoderInfo *p; @@ -391,6 +394,14 @@ MagickExport MagickBooleanType RegisterStaticModule(const char *module, Assign module name from alias. */ assert(module != (const char *) NULL); + rights=ReadPolicyRights; + if (IsRightsAuthorized(ModulePolicyDomain,rights,module) == MagickFalse) + { + errno=EPERM; + (void) ThrowMagickException(exception,GetMagickModule(),PolicyError, + "NotAuthorized","`%s'",module); + return(MagickFalse); + } (void) CopyMagickString(module_name,module,MagickPathExtent); p=GetCoderInfo(module,exception); if (p != (CoderInfo *) NULL)