[X2Go-Commits] [nx-libs] 173/429: Atoms.c: fix strlen(NULL)

git-admin at x2go.org git-admin at x2go.org
Mon Oct 18 09:36:24 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit 1529b32174867acaffc952b77cb404180fad17f1
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Mon Aug 3 16:25:00 2020 +0200

    Atoms.c: fix strlen(NULL)
    
    FIX PVS Studio finding "V575 The potential null pointer is passed into
    'strlen' function. Inspect the first argument"
---
 nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
index c15674f5e..af8b31dfd 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
@@ -417,7 +417,7 @@ static void nxagentWriteAtom(Atom local, XlibAtom remote, const char *string)
   privAtomMap[privLastAtom].local = local;
   privAtomMap[privLastAtom].remote = remote;
   privAtomMap[privLastAtom].string = s;
-  privAtomMap[privLastAtom].length = strlen(s);
+  privAtomMap[privLastAtom].length = s ? strlen(s) : 0;
 
   privLastAtom++;
 }

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list