Skip to content
Permalink
Browse files Browse the repository at this point in the history
Added missing policy checks in RegisterStaticModules.
  • Loading branch information
dlemstra committed Sep 11, 2021
1 parent d2a2f1c commit 35893e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MagickCore/static.c
Expand Up @@ -240,7 +240,7 @@ MagickExport MagickBooleanType RegisterStaticModule(const char *module,
p=GetCoderInfo(module,exception);
if (p != (CoderInfo *) NULL)
(void) CopyMagickString(module_name,p->name,MagickPathExtent);
rights=ReadPolicyRights;
rights=AllPolicyRights;
if (IsRightsAuthorized(ModulePolicyDomain,rights,module_name) == MagickFalse)
{
errno=EPERM;
Expand Down Expand Up @@ -294,6 +294,9 @@ MagickExport void RegisterStaticModules(void)
{
if (MagickModules[i].registered == MagickFalse)
{
if (IsRightsAuthorized(ModulePolicyDomain,AllPolicyRights,
MagickModules[i].module) == MagickFalse)
continue;
(void) (MagickModules[i].register_module)();
MagickModules[i].registered=MagickTrue;
}
Expand Down

0 comments on commit 35893e7

Please sign in to comment.