[PATCH] msdmo: Fix null deref in any_types_match.

Zebediah Figura z.figura12 at gmail.com
Wed Sep 30 10:55:48 CDT 2020


Hello Patrick,

On 9/30/20 8:43 AM, Patrick Hibbs wrote:
> Signed-off-by: Patrick Hibbs <hibbsncc1701 at gmail.com>
> ---
>  dlls/msdmo/dmoreg.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c
> index 8e0680931f4..42e4eab3651 100644
> --- a/dlls/msdmo/dmoreg.c
> +++ b/dlls/msdmo/dmoreg.c
> @@ -451,10 +451,16 @@ static BOOL any_types_match(const DMO_PARTIAL_MEDIATYPE *a, unsigned int a_count
>  
>      for (i = 0; i < a_count; ++i)
>      {
> -        for (j = 0; j < b_count; ++j)
> +        if (a != NULL)
>          {
> -            if (IsMediaTypeEqual(&a[i], &b[j]))
> -                return TRUE;
> +            for (j = 0; j < b_count; ++j)
> +            {
> +                if (b != NULL)
> +                {
> +                    if (IsMediaTypeEqual(&a[i], &b[j]))
> +                        return TRUE;
> +                }
> +            }
>          }
>      }
>      return FALSE;
> 

This seems like the wrong solution; "types" shouldn't be NULL if "size"
is nonzero. That it is is a bug in itself, which I diagnosed in [1] but
never got around to sending a patch for...

[1] https://bugs.winehq.org/show_bug.cgi?id=49659

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200930/9ad21dab/attachment.sig>


More information about the wine-devel mailing list