diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-10-03 23:05:20 +0200 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2019-10-03 23:06:57 +0200 |
commit | dc7a78b4553cda0e18b9083fb362bf9301660e01 (patch) | |
tree | f10f5548b9f08f0ec8bba628d236e78bd5960d2c /nx-X11/programs/Xserver/hw/nxagent | |
parent | 5405447e5a0ec582a474a0e506265475bd4fd5a8 (diff) | |
download | nx-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.c | 3 |
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") || |