]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sat, 25 Aug 2018 00:59:00 +0000 (20:59 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 25 Aug 2018 00:59:00 +0000 (20:59 -0400)
MagickCore/static.c

index fafa106ab85de79cad842eef9e346f768001543b..14cf7c066a0095fcc1b852fa33a820e600151320 100644 (file)
@@ -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)