]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - gui.c
gui: Discard overlong input lines.
[paraslash.git] / gui.c
diff --git a/gui.c b/gui.c
index 65b2ac05d748ab1bb7d24e3b752d906d2ffca5c5..728fb9b72c815237ca5aa51c9d590afa312e0464 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1998-2012 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1998-2013 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -951,7 +951,7 @@ static int open_stat_pipe(void)
        return ret;
 }
 
-#define COMMAND_BUF_SIZE 4096
+#define COMMAND_BUF_SIZE 32768
 
 /*
  * This is the core select loop. Besides the (internal) signal
@@ -1023,6 +1023,10 @@ repeat:
                                if (command_fds[!i] < 0) /* both fds closed */
                                        return 0;
                        }
+                       if (cbo[i] == COMMAND_BUF_SIZE - 1) {
+                               PARA_NOTICE_LOG("discarding overlong line");
+                               cbo[i] = 0;
+                       }
                }
        }
        ret = read_stat_pipe(&rfds);
@@ -1486,8 +1490,7 @@ int main(int argc, char *argv[])
        _argc = argc;
        _argv = argv;
 
-       if (gui_cmdline_parser(argc, argv, &conf) != 0)
-               exit(EXIT_FAILURE);
+       gui_cmdline_parser(argc, argv, &conf); /* exits on errors */
        HANDLE_VERSION_FLAG("gui", conf);
        cf = configfile_exists();
        if (!cf && conf.config_file_given) {