From 1529b32174867acaffc952b77cb404180fad17f1 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 3 Aug 2020 16:25:00 +0200 Subject: 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++; } -- cgit v1.2.3