From 1a86fba0d9ae2e107e3ed23519ab3b84d2e5240e 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 9fc6ddaf4..ec0c41c76 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1694,7 +1694,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; }