diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-03-25 22:08:46 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-03-25 22:08:46 +0000 |
commit | 3377d3a643b187e93cb4a8b5a9cd05f6f48df72a (patch) | |
tree | fa3f650e20284abdcb1b8b79a7adfb3cc37cb3b6 /mh | |
parent | 18690e0e6677191f24787c6d340a6a80563cba4b (diff) | |
download | mailutils-3377d3a643b187e93cb4a8b5a9cd05f6f48df72a.tar.gz mailutils-3377d3a643b187e93cb4a8b5a9cd05f6f48df72a.tar.bz2 |
(builtin_concat): Extra safety check
(builtin_in_reply_to,builtin_references): Check return value
from the underlying library calls.
Diffstat (limited to 'mh')
-rw-r--r-- | mh/mh_format.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/mh/mh_format.c b/mh/mh_format.c index 91b5a657e..9474746f1 100644 --- a/mh/mh_format.c +++ b/mh/mh_format.c @@ -1846,6 +1846,9 @@ static void builtin_concat (struct mh_machine *mach) { size_t size = strobj_len (&mach->arg_str); + + if (size == 0) + return; compress_ws (strobj_ptr (&mach->arg_str), &size); if (strobj_len (&mach->reg_str) == 0) strobj_copy (&mach->reg_str, &mach->arg_str); @@ -1876,9 +1879,11 @@ builtin_in_reply_to (struct mh_machine *mach) char *value; strobj_free (&mach->arg_str); - mu_rfc2822_in_reply_to (mach->message, &value); - strobj_create (&mach->arg_str, value); - free (value); + if (mu_rfc2822_in_reply_to (mach->message, &value)) + { + strobj_create (&mach->arg_str, value); + free (value); + } } static void @@ -1887,9 +1892,11 @@ builtin_references (struct mh_machine *mach) char *value; strobj_free (&mach->arg_str); - mu_rfc2822_references (mach->message, &value); - strobj_create (&mach->arg_str, value); - free (value); + if (mu_rfc2822_references (mach->message, &value) == 0) + { + strobj_create (&mach->arg_str, value); + free (value); + } } static void |