[PATCH:libX11 1/2] Fix map->num_types check in XkbAddKeyType()

Matthieu Herrb matthieu at herrb.eu
Wed Jul 9 21:36:33 PDT 2014


On 07/09/2014 10:34 PM, Alan Coopersmith wrote:
> Check is intended to ensure we allocate at least XkbNumRequiredTypes
> in map, but was accidentally marked with a ! causing the wrong check.
>
> Reported-by: Harms <wharms at bfs,de>
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

Reviewed-by: Matthieu Herrb <matthieu at herrb.eu>

> ---
>   src/xkb/XKBMAlloc.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/xkb/XKBMAlloc.c b/src/xkb/XKBMAlloc.c
> index 0b86aa1..2e39634 100644
> --- a/src/xkb/XKBMAlloc.c
> +++ b/src/xkb/XKBMAlloc.c
> @@ -300,7 +300,7 @@ XkbAddKeyType(XkbDescPtr xkb,
>               }
>           }
>       }
> -    if ((!map) || (!map->types) || (!map->num_types < XkbNumRequiredTypes)) {
> +    if ((!map) || (!map->types) || (map->num_types < XkbNumRequiredTypes)) {
>           tmp = XkbNumRequiredTypes + 1;
>           if (XkbAllocClientMap(xkb, XkbKeyTypesMask, tmp) != Success)
>               return NULL;
>



More information about the xorg-devel mailing list