From 80284fae7e4975f3f85eb171576707ae4deb6cda Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 8 Sep 2024 09:45:54 -0700 Subject: [PATCH] dix: SetFontPath: don't set errorValue on Success MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clears warning from gcc 14.1: ../dix/dixfonts.c: In function ‘SetFontPath’: ../dix/dixfonts.c:1697:28: warning: use of uninitialized value ‘bad’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 1697 | client->errorValue = bad; | ~~~~~~~~~~~~~~~~~~~^~~~~ Signed-off-by: Alan Coopersmith Part-of: --- dix/dixfonts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 35f458c96..c93077970 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1692,7 +1692,8 @@ SetFontPath(ClientPtr client, int npaths, unsigned char *paths) int bad; err = SetFontPathElements(npaths, paths, &bad, FALSE); - client->errorValue = bad; + if (err != Success) + client->errorValue = bad; } return err; }