[PATCH 17/32] [libx11] Dereferencing possibly NULL "str" in call to function "memcpy" (Deref assumed on the basis of 'nonnull' parameter attribute.)

Dirk Wallenstein halsmit at t-online.de
Thu Jan 27 04:26:57 PST 2011


On Thu, Jan 27, 2011 at 09:54:00AM +0200, Erkki Seppälä wrote:
> If _XkbGetReadBufferPtr returns NULL, goto BAILOUT
> 
> Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
> Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
> ---
>  src/xkb/XKBList.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/src/xkb/XKBList.c b/src/xkb/XKBList.c
> index e1b4127..dec96b7 100644
> --- a/src/xkb/XKBList.c
> +++ b/src/xkb/XKBList.c
> @@ -79,6 +79,8 @@ char *			str;
>  	if (!this->name)
>  	    goto BAILOUT;
>  	str= (char *)_XkbGetReadBufferPtr(buf,wlen);
> +	if (!str) 
> +	    goto BAILOUT;
>  	memcpy(this->name,str,slen);
>      }
>      return first;
> -- 
> 1.7.0.4
> 

Reviewed-by: Dirk Wallenstein <halsmit at t-online.de>

-- 
Greetings,
Dirk


More information about the xorg-devel mailing list