[PATCH libX11] Fix three "use of uninitialized variable" coverity warnings

Hans de Goede hdegoede at redhat.com
Tue May 19 01:08:02 PDT 2015


Hi,

On 19-05-15 04:42, Peter Hutterer wrote:
> False positive, if rlen/nbytes are unset we quit early before using it. Still,
> initialize it so we don't have to deal with these warnings again.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

LGTM: Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans


> ---
>   src/FontNames.c | 2 +-
>   src/GetFPath.c  | 2 +-
>   src/ListExt.c   | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/FontNames.c b/src/FontNames.c
> index 6fc6b12..21dcafe 100644
> --- a/src/FontNames.c
> +++ b/src/FontNames.c
> @@ -47,7 +47,7 @@ int *actualCount)	/* RETURN */
>       int count = 0;
>       xListFontsReply rep;
>       register xListFontsReq *req;
> -    unsigned long rlen;
> +    unsigned long rlen = 0;
>
>       LockDisplay(dpy);
>       GetReq(ListFonts, req);
> diff --git a/src/GetFPath.c b/src/GetFPath.c
> index 62ba014..8c3f49c 100644
> --- a/src/GetFPath.c
> +++ b/src/GetFPath.c
> @@ -35,7 +35,7 @@ char **XGetFontPath(
>       int *npaths)	/* RETURN */
>   {
>   	xGetFontPathReply rep;
> -	unsigned long nbytes;
> +	unsigned long nbytes = 0;
>   	char **flist = NULL;
>   	char *ch = NULL;
>   	char *chend;
> diff --git a/src/ListExt.c b/src/ListExt.c
> index 431ae67..be6b989 100644
> --- a/src/ListExt.c
> +++ b/src/ListExt.c
> @@ -42,7 +42,7 @@ char **XListExtensions(
>   	register unsigned i;
>   	register int length;
>   	register xReq *req;
> -	unsigned long rlen;
> +	unsigned long rlen = 0;
>
>   	LockDisplay(dpy);
>   	GetEmptyReq (ListExtensions, req);
>


More information about the xorg-devel mailing list