summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-09-14 08:02:02 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-09-14 08:02:02 +0000
commita9ddefb1bf21402ed6939139e6eecb51f11ae697 (patch)
tree3e9b809be0ddbdd4f1a212d9c2b5c28c11152bf9 /init.c
parent9d798ca84a8d5f05cb908c0879f950f72e68086c (diff)
[patch-0.94.6.vikas.complete.1] Fix a completion-related
buffer overflow.
Diffstat (limited to 'init.c')
-rw-r--r--init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/init.c b/init.c
index 32c82b16..e4db2bd7 100644
--- a/init.c
+++ b/init.c
@@ -1285,9 +1285,9 @@ int mutt_string_var_complete (char *buffer, size_t len, int pos)
/* ignore the trailing '=' when comparing */
strncmp (MuttVars[i].option, pt, strlen (pt) - 1) == 0)
{
- strncat (pt, "\"", buffer + len - pt);
- strncat (pt, NONULL (*((char **) MuttVars[i].data)), buffer + len - pt);
- strncat (pt, "\"", buffer + len - pt);
+ char tmp [LONG_STRING];
+ strcpy (tmp, pt);
+ snprintf (pt, len, "%s\"%s\"",tmp, NONULL (*((char **) MuttVars[i].data)));
return 1;
}
}