aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-10-03 23:05:20 +0200
committerUlrich Sibiller <uli42@gmx.de>2019-10-03 23:06:57 +0200
commitdc7a78b4553cda0e18b9083fb362bf9301660e01 (patch)
treef10f5548b9f08f0ec8bba628d236e78bd5960d2c /nx-X11/programs/Xserver/hw/nxagent
parent5405447e5a0ec582a474a0e506265475bd4fd5a8 (diff)
downloadnx-libs-dc7a78b4553cda0e18b9083fb362bf9301660e01.tar.gz
nx-libs-dc7a78b4553cda0e18b9083fb362bf9301660e01.tar.bz2
nx-libs-dc7a78b4553cda0e18b9083fb362bf9301660e01.zip
Fix segfault in argument parsing
Using arguments that need a parameter without providing one would lead a segfault due to calling strcmp() will NULL. Triggered by running "nxagent -ac :1 -options nx/nx,fullscreen" or similar, Fixes ArcticaProject/nx-libs#847
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Args.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c
index 2d998980c..abdb650a4 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Args.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c
@@ -1103,6 +1103,9 @@ static void nxagentParseSingleOption(char *name, char *value)
URLDecodeInPlace(value);
+ if (!value)
+ value = "";
+
if (!strcmp(name, "kbtype") ||
!strcmp(name, "keyboard") ||
!strcmp(name, "id") ||