kernel32: K32EnumProcessModules: Handle NULL pointer gracefully.

Olivier F. R. Dierick o.dierick at piezo-forte.be
Wed Jul 1 07:22:19 CDT 2015


Le mardi 30 juin 2015 à 16:04 -0600, Alex Henrie a écrit :
> > diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c
> > index f495e81..5461881 100644
> > --- a/dlls/kernel32/module.c
> > +++ b/dlls/kernel32/module.c
> > @@ -1226,6 +1226,12 @@ BOOL WINAPI K32EnumProcessModules(HANDLE process, HMODULE *lphModule,
> >     if (!init_module_iterator(&iter, process))
> >         return FALSE;
> >
> > +    if (!lphModule)
> > +    {
> > +        SetLastError(ERROR_NOACCESS);
> > +        return FALSE;
> > +    }
> > +
> >     if (!needed)
> >     {
> >          SetLastError(ERROR_NOACCESS);
> 
> Wouldn't it be easier to write "if (!lphModule || !needed)"? Adding a
> test or two would also be nice.
> 
> -Alex

That would be fine for me. I'll check the behavior of actual Windows and
write appropriate conformance tests. I'll send a new patch accordingly.
-- 
        Olivier F. R. Dierick
        o.dierick at piezo-forte.be




More information about the wine-devel mailing list