summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/dispatch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/dispatch.c b/server/dispatch.c
index 01c5a2f..56c38ad 100644
--- a/server/dispatch.c
+++ b/server/dispatch.c
@@ -320,7 +320,7 @@ sendit(ZNotice_t *notice,
int external)
{
static int send_counter = 0;
- char recipbuf[ANAME_SZ + INST_SZ + REALM_SZ + 3], *recipp;
+ char recipbuf[MAX_PRINCIPAL_SIZE], *recipp;
int any = 0;
Acl *acl;
Destination dest;
@@ -389,7 +389,8 @@ sendit(ZNotice_t *notice,
strncpy(recipbuf, notice->z_recipient, sizeof(recipbuf));
recipp = strrchr(recipbuf, '@');
if (recipp)
- sprintf(recipp + 1, "%s", realm_expand_realm(recipp + 1));
+ snprintf(recipp + 1, sizeof(recipbuf) - (recipp - recipbuf),
+ "%s", realm_expand_realm(recipp + 1));
dest.recip = make_string(recipbuf, 0);
}