From: Richard Russon Date: Tue, 29 May 2018 14:38:06 +0000 (+0100) Subject: Create a large buffer for command strings X-Git-Tag: neomutt-20180622~25^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f01734a48ca746dd789178fd509b7864df8cd95;p=neomutt Create a large buffer for command strings --- diff --git a/attach.c b/attach.c index df6e7474d..78e09b612 100644 --- 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"); diff --git a/commands.c b/commands.c index 773d55c7e..b89ab86be 100644 --- a/commands.c +++ b/commands.c @@ -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); diff --git a/curs_lib.c b/curs_lib.c index b25c0e007..8faada1df 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -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); diff --git a/handler.c b/handler.c index 3d1114778..d719ed06d 100644 --- 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 3039e79b7..2f4f2cd41 100644 --- 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; diff --git a/remailer.c b/remailer.c index 9e722abfc..29a56c1eb 100644 --- a/remailer.c +++ b/remailer.c @@ -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; diff --git a/rfc1524.c b/rfc1524.c index 92b8b8e0f..2f4b1251d 100644 --- 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));