summaryrefslogtreecommitdiff
path: root/lib/Zinternal.c
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>1997-09-23 01:58:26 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>1997-09-23 01:58:26 +0000
commit14b8946f493d3ac02c4468c57fd411b31c4c0894 (patch)
tree090afd2995bac6a250f6d5a0169743f3cc566227 /lib/Zinternal.c
parent00952bc3a6ffb87a25d5c492c62b3a6680841286 (diff)
From mhpower: avoid possible buffer overflows.
Diffstat (limited to 'lib/Zinternal.c')
-rw-r--r--lib/Zinternal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Zinternal.c b/lib/Zinternal.c
index 019bafd..446fdc4 100644
--- a/lib/Zinternal.c
+++ b/lib/Zinternal.c
@@ -741,6 +741,9 @@ Code_t Z_FormatRawHeader(notice, buffer, buffer_len, len, cstart, cend)
return (ZERR_HEADERLEN);
}
else {
+ if (strlen(notice->z_recipient) + strlen(__Zephyr_realm) + 2 >
+ sizeof(newrecip))
+ return (ZERR_HEADERLEN);
(void) sprintf(newrecip, "%s@%s", notice->z_recipient, __Zephyr_realm);
if (Z_AddField(&ptr, newrecip, end))
return (ZERR_HEADERLEN);