[PATCH] plugin: fix forbidden_product_strings check in apply_post_probing_filters

Dan Williams dcbw at redhat.com
Fri Aug 11 22:42:57 UTC 2017


On Fri, 2017-08-11 at 11:23 -0700, Ben Chan wrote:
> This patch fixes a bug in apply_post_probing_filters() where it
> iterates
> through `self->priv->forbidden_product_strings' but incorrectly
> accesses
> `self->priv->product_strings[i]' inside the loop.
> `self->priv->forbidden_product_strings[i]' should be accessed
> instead.

Thanks, pushed to git master and mm-1-6.

Dan

> ---
>  src/mm-plugin.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mm-plugin.c b/src/mm-plugin.c
> index d2fa4a11..dc9f184d 100644
> --- a/src/mm-plugin.c
> +++ b/src/mm-plugin.c
> @@ -535,8 +535,8 @@ apply_post_probing_filters (MMPlugin *self,
>                  gchar *casefolded_vendor;
>                  gchar *casefolded_product;
>  
> -                casefolded_vendor = g_utf8_casefold (self->priv-
> >product_strings[i].l, -1);
> -                casefolded_product = g_utf8_casefold (self->priv-
> >product_strings[i].r, -1);
> +                casefolded_vendor = g_utf8_casefold (self->priv-
> >forbidden_product_strings[i].l, -1);
> +                casefolded_product = g_utf8_casefold (self->priv-
> >forbidden_product_strings[i].r, -1);
>                  found = (!!strstr (vendor, casefolded_vendor) &&
>                           !!strstr (product, casefolded_product));
>                  g_free (casefolded_vendor);


More information about the ModemManager-devel mailing list