summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/src/parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/src/parse.c b/src/src/parse.c
index 32b42cd29..086b010c3 100644
--- a/src/src/parse.c
+++ b/src/src/parse.c
@@ -979,12 +979,12 @@ if (i < len)
/* No non-printers; use the RFC 822 quoting rules */
-if (!len)
+if (len <= 0 || len >= INT_MAX/4)
{
- return string_copy_taint(US"", is_tainted(phrase));
+ return string_copy_taint(CUS"", is_tainted(phrase));
}
-buffer = store_get(len*4, is_tainted(phrase));
+buffer = store_get((len+1)*4, is_tainted(phrase));
s = phrase;
end = s + len;