[PATCH xserver] xkb: initialize tsyms

Eric Engestrom eric.engestrom at imgtec.com
Mon Nov 6 15:41:27 UTC 2017


On Friday, 2017-11-03 21:38:51 +0100, Giuseppe Bilotta wrote:
> This fixes some “Conditional jump depends on uninitialized value(s)”
> errors spotted by valgrind.
> 
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>

Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

Although the rest of the array is 0-initialised, so this only works
because NoSymbol is also 0.

> ---
>  xkb/xkbUtils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
> index 25b5a364e..8975ade8d 100644
> --- a/xkb/xkbUtils.c
> +++ b/xkb/xkbUtils.c
> @@ -222,7 +222,7 @@ XkbUpdateKeyTypesFromCore(DeviceIntPtr pXDev,
>      XkbDescPtr xkb;
>      unsigned key, nG, explicit;
>      int types[XkbNumKbdGroups];
> -    KeySym tsyms[XkbMaxSymsPerKey], *syms;
> +    KeySym tsyms[XkbMaxSymsPerKey] = {NoSymbol}, *syms;
>      XkbMapChangesPtr mc;
>  
>      xkb = pXDev->key->xkbInfo->desc;
> -- 
> 2.14.1.439.g647b9b4702
> 


More information about the xorg-devel mailing list