summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-12-05 09:32:06 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-12-05 09:32:06 +0000
commit84a1358194918ae1f4fa92ed9912395ea206b6d5 (patch)
tree475b00bd59b7060af0ebf5b9d526aa42d5e1a4a1 /mail
parentb690dcf3b4d5732809108c43da893bfe05ab90fd (diff)
downloadmailutils-84a1358194918ae1f4fa92ed9912395ea206b6d5.tar.gz
mailutils-84a1358194918ae1f4fa92ed9912395ea206b6d5.tar.bz2
(util_do_command): Fix memory overrun
Diffstat (limited to 'mail')
-rw-r--r--mail/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mail/util.c b/mail/util.c
index 3f4b3220f..2cc5c0a24 100644
--- a/mail/util.c
+++ b/mail/util.c
@@ -120,7 +120,8 @@ util_do_command (const char *c, ...)
{
argc++;
argv = xrealloc (argv, (argc + 1)*sizeof argv[0]);
- memmove (argv + 2, argv + 1, argc*sizeof argv[0]);
+ if (argc > 2)
+ memmove (argv + 2, argv + 1, (argc - 2)*sizeof argv[0]);
argv[1] = xstrdup (p);
*p = 0;
}

Return to:

Send suggestions and report system problems to the System administrator.