diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-11-10 20:23:29 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-11-10 20:23:29 +0000 |
commit | 895ae34c57fef2095747bf85e9ffca718e2e0313 (patch) | |
tree | dbcea458c687f5d19b36d1361ac27813d51aed6d /edit.c | |
parent | 85eb7262118c35356af50711dfc1e42ed50d39b6 (diff) |
Fix a possible buffer overflow. (This seems to be the one noticed
by Pavel Gulchouck <gul@lucky.net>.)
Diffstat (limited to 'edit.c')
-rw-r--r-- | edit.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -357,7 +357,7 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) if (Context) { if (!*p && cur) - { + { /* include the current message */ p = tmp + strlen (tmp) + 1; snprintf (tmp + strlen (tmp), sizeof (tmp) - strlen (tmp), " %d", @@ -447,7 +447,7 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) done = 1; else { - strcat (tmp, "\n"); + strncat (tmp, "\n", sizeof(tmp)); tmp[sizeof(tmp) - 1] = '\0'; if (buflen == bufmax) safe_realloc ((void **)&buf, sizeof (char *) * (bufmax += 25)); buf[buflen++] = safe_strdup (tmp[1] == '~' ? tmp + 1 : tmp); |