summaryrefslogtreecommitdiffstats
path: root/package/lcdproc/lcdproc-0.5.5-fix-menu-segfault.patch
diff options
context:
space:
mode:
authorSimon Dawson <spdawson@gmail.com>2012-10-04 21:30:21 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2012-10-08 22:33:51 +0200
commit183b83e2083e778a2fdac07ab61ebd1f3ed4356a (patch)
tree8d290a0c5f9e888850c39b78b644d98207f1422a /package/lcdproc/lcdproc-0.5.5-fix-menu-segfault.patch
parent23467d5e2c36866899bbe644c3adf7409cdba6d6 (diff)
downloadbuildroot-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-menu-segfault.patch')
-rw-r--r--package/lcdproc/lcdproc-0.5.5-fix-menu-segfault.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/package/lcdproc/lcdproc-0.5.5-fix-menu-segfault.patch b/package/lcdproc/lcdproc-0.5.5-fix-menu-segfault.patch
new file mode 100644
index 000000000..f0ebe2dec
--- /dev/null
+++ b/package/lcdproc/lcdproc-0.5.5-fix-menu-segfault.patch
@@ -0,0 +1,19 @@
+Trying to add a menu item using menu_add_item causes a segmentation fault
+in the LCDd server. This is caused by a read beyond the end of an array.
+
+This patch adds a safety check on the size of the argument array.
+
+Signed-off-by: Simon Dawson <spdawson@gmail.com>
+
+diff -Nurp a/server/commands/menu_commands.c b/server/commands/menu_commands.c
+--- a/server/commands/menu_commands.c 2011-08-14 13:29:16.000000000 +0100
++++ b/server/commands/menu_commands.c 2012-10-04 22:19:07.997409193 +0100
+@@ -198,7 +198,7 @@ menu_add_item_func(Client *c, int argc,
+
+ /* call menu_set_item() with a temporarily allocated argv
+ * to process the remaining options */
+- if ((argc > 5) || (argv[4][0] == '-')) {
++ if ((argc > 5) || ((argc == 5) && argv[4][0] == '-')) {
+ // menu_add_item <menuid> <newitemid> <type> [<text>]
+ // menu_set_item <menuid> <itemid> {<option>}+
+ int i, j;