]> granicus.if.org Git - neomutt/commitdiff
Create a large buffer for command strings
authorRichard Russon <rich@flatcap.org>
Tue, 29 May 2018 14:38:06 +0000 (15:38 +0100)
committerRichard Russon <rich@flatcap.org>
Wed, 6 Jun 2018 14:46:22 +0000 (15:46 +0100)
attach.c
commands.c
curs_lib.c
handler.c
query.c
remailer.c
rfc1524.c

index df6e7474d96965720b86c26fbefe64477ee7c3a9..78e09b61228c448c9d455f2a28c32b0a885e8d82 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -96,7 +96,7 @@ int mutt_get_tmp_attachment(struct Body *a)
 int mutt_compose_attachment(struct Body *a)
 {
   char type[STRING];
-  char command[STRING];
+  char command[HUGE_STRING];
   char newfile[_POSIX_PATH_MAX] = "";
   struct Rfc1524MailcapEntry *entry = rfc1524_new_entry();
   bool unlink_newfile = false;
@@ -233,7 +233,7 @@ bailout:
 int mutt_edit_attachment(struct Body *a)
 {
   char type[STRING];
-  char command[STRING];
+  char command[HUGE_STRING];
   char newfile[_POSIX_PATH_MAX] = "";
   struct Rfc1524MailcapEntry *entry = rfc1524_new_entry();
   bool unlink_newfile = false;
@@ -991,7 +991,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
 
   if (rfc1524_mailcap_lookup(a, type, NULL, MUTT_PRINT))
   {
-    char command[_POSIX_PATH_MAX + STRING];
+    char command[HUGE_STRING];
     int piped = false;
 
     mutt_debug(2, "Using mailcap...\n");
index 773d55c7e98d7a0b3a32121ef909d777616faa03..b89ab86be10f923a8aa9cda7ac7f2ed84829d563 100644 (file)
@@ -230,11 +230,12 @@ int mutt_display_message(struct Header *cur)
   {
     int r;
 
+    char cmd[HUGE_STRING];
     mutt_endwin();
-    snprintf(buf, sizeof(buf), "%s %s", NONULL(Pager), tempfile);
-    r = mutt_system(buf);
+    snprintf(cmd, sizeof(cmd), "%s %s", NONULL(Pager), tempfile);
+    r = mutt_system(cmd);
     if (r == -1)
-      mutt_error(_("Error running \"%s\"!"), buf);
+      mutt_error(_("Error running \"%s\"!"), cmd);
     unlink(tempfile);
     if (!OptNoCurses)
       keypad(stdscr, true);
index b25c0e007d10c263ffc3600282743f53257d6b8c..8faada1df748f15823b397f64d21ee0f7df1c835 100644 (file)
@@ -204,7 +204,7 @@ int mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags)
 
 void mutt_edit_file(const char *editor, const char *data)
 {
-  char cmd[LONG_STRING];
+  char cmd[HUGE_STRING];
 
   mutt_endwin();
   mutt_expand_file_fmt(cmd, sizeof(cmd), editor, data);
index 3d1114778979180cae72869bb7784485fa3bf557..d719ed06d1e01b3147c5f7b18186a36121b659e8 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -510,7 +510,7 @@ static int autoview_handler(struct Body *a, struct State *s)
   struct Rfc1524MailcapEntry *entry = rfc1524_new_entry();
   char buffer[LONG_STRING];
   char type[STRING];
-  char command[LONG_STRING];
+  char command[HUGE_STRING];
   char tempfile[_POSIX_PATH_MAX] = "";
   char *fname = NULL;
   FILE *fpin = NULL;
diff --git a/query.c b/query.c
index 3039e79b7c92048db853446d9dd4a138bcf3b98c..2f4f2cd41d19a85eaba8a6e2e76cff0251c6e781 100644 (file)
--- a/query.c
+++ b/query.c
@@ -112,7 +112,7 @@ static struct Query *run_query(char *s, int quiet)
   FILE *fp = NULL;
   struct Query *first = NULL;
   struct Query *cur = NULL;
-  char cmd[_POSIX_PATH_MAX];
+  char cmd[HUGE_STRING];
   char *buf = NULL;
   size_t buflen;
   int dummy = 0;
index 9e722abfc870f2db81996f06ab385e1a2b05f83f..29a56c1eb1a3c9cfdea2588d28310eb8f274693c 100644 (file)
@@ -128,7 +128,7 @@ static struct Remailer **mix_type2_list(size_t *l)
   pid_t mm_pid;
   int devnull;
 
-  char cmd[HUGE_STRING + _POSIX_PATH_MAX];
+  char cmd[HUGE_STRING];
   char line[HUGE_STRING];
   char *t = NULL;
 
index 92b8b8e0f20c0833046f220dce96e83f66b8b7a4..2f4b1251d213f28297211289653eb8fd273a10f0 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
@@ -68,7 +68,7 @@ int rfc1524_expand_command(struct Body *a, char *filename, char *type, char *com
 {
   int x = 0, y = 0;
   int needspipe = true;
-  char buf[LONG_STRING];
+  char buf[HUGE_STRING];
   char type2[LONG_STRING];
 
   mutt_str_strfcpy(type2, type, sizeof(type2));