diff options
author | Simon Dawson <spdawson@gmail.com> | 2012-10-04 21:30:21 +0000 |
---|---|---|
committer | Peter Korsgaard <jacmet@sunsite.dk> | 2012-10-08 22:33:51 +0200 |
commit | 183b83e2083e778a2fdac07ab61ebd1f3ed4356a (patch) | |
tree | 8d290a0c5f9e888850c39b78b644d98207f1422a /package/lcdproc/lcdproc-0.5.5-fix-client_add_key-for-minus.patch | |
parent | 23467d5e2c36866899bbe644c3adf7409cdba6d6 (diff) | |
download | buildroot-novena-183b83e2083e778a2fdac07ab61ebd1f3ed4356a.tar.gz buildroot-novena-183b83e2083e778a2fdac07ab61ebd1f3ed4356a.zip |
lcdproc: backport upstream patches
Backport some lcdproc patches from upstream, to fix the following issues.
* Incorrect parsing of minus key in handler for client_add_key command
* Segfault in handler for menu_add_item command
Signed-off-by: Simon Dawson <spdawson@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/lcdproc/lcdproc-0.5.5-fix-client_add_key-for-minus.patch')
-rw-r--r-- | package/lcdproc/lcdproc-0.5.5-fix-client_add_key-for-minus.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/package/lcdproc/lcdproc-0.5.5-fix-client_add_key-for-minus.patch b/package/lcdproc/lcdproc-0.5.5-fix-client_add_key-for-minus.patch new file mode 100644 index 000000000..c17ee83af --- /dev/null +++ b/package/lcdproc/lcdproc-0.5.5-fix-client_add_key-for-minus.patch @@ -0,0 +1,38 @@ +Calling client_add_key as follows + + client_add_key - + +will fail. However using an explicit -shared option, like this: + + client_add_key -shared - + +will succeed. This is caused by a failure to parse the - key token, which is +mistaken for the first character of an option argument. + +The client_add_key command also returns a spurious "success" message when a +malformed option is supplied. + +This patch fixes both issues. + +Signed-off-by: Simon Dawson <spdawson@gmail.com> + +diff -Nurp a/server/commands/client_commands.c b/server/commands/client_commands.c +--- a/server/commands/client_commands.c 2011-08-14 13:29:16.000000000 +0100 ++++ b/server/commands/client_commands.c 2012-10-05 07:50:40.357795535 +0100 +@@ -181,7 +181,7 @@ client_add_key_func(Client *c, int argc, + } + + argnr = 1; +- if (argv[argnr][0] == '-') { ++ if (argv[argnr][0] == '-' && strcmp(argv[argnr], "-") != 0) { + if (strcmp( argv[argnr], "-shared") == 0) { + exclusively = 0; + } +@@ -190,6 +190,7 @@ client_add_key_func(Client *c, int argc, + } + else { + sock_printf_error(c->sock, "Invalid option: %s\n", argv[argnr]); ++ return 0; + } + argnr++; + } |