summaryrefslogtreecommitdiff
path: root/server/kstuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/kstuff.c')
-rw-r--r--server/kstuff.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/server/kstuff.c b/server/kstuff.c
index 3a013e1..4ad951d 100644
--- a/server/kstuff.c
+++ b/server/kstuff.c
@@ -440,7 +440,7 @@ ZCheckRealmAuthentication(ZNotice_t *notice,
if (notice->z_num_other_fields)
x = notice->z_other_fields[notice->z_num_other_fields - 1];
else {
- /* see also lib/ZCkZaut.c:ZCheckZcodeAuthentication */
+ /* see also ZCheckAuthentication and lib/ZCkZaut.c:ZCheckZcodeAuthentication */
/* XXXXXXXXXXXXXXXXXXXXXXX */
x = cksum1_base + strlen(cksum1_base) + 1; /* multinotice */
if (notice->z_num_hdr_fields > 17)
@@ -730,9 +730,16 @@ ZCheckAuthentication(ZNotice_t *notice,
cksum1_base = notice->z_multinotice;
if (notice->z_num_other_fields)
x = notice->z_other_fields[notice->z_num_other_fields - 1];
- else
- x = cksum1_base + strlen(cksum1_base) + 1; /* multiuid */
- cksum1_len = x + strlen(x) + 1 - cksum1_base;
+ else {
+ /* see also ZCheckRealmAuthentication and lib/ZCkZaut.c:ZCheckZcodeAuthentication */
+ /* XXXXXXXXXXXXXXXXXXXXXXX */
+ x = cksum1_base + strlen(cksum1_base) + 1; /* multinotice */
+ if (notice->z_num_hdr_fields > 17)
+ x = x + strlen(x) + 1; /* multiuid */
+ if (notice->z_num_hdr_fields > 18)
+ x = x + strlen(x) + 1; /* sender */
+ }
+ cksum1_len = x + strlen(x) + 1 - cksum1_base; /* charset / extra field */
/* last part is the message body */
cksum2_base = notice->z_message;