|
Lines 284-289
Link Here
|
| 284 |
int r; |
284 |
int r; |
| 285 |
|
285 |
|
| 286 |
if (!ulen) ulen = strlen(user); |
286 |
if (!ulen) ulen = strlen(user); |
|
|
287 |
if (ulen > MAX_MAILBOX_NAME) |
| 288 |
ulen = MAX_MAILBOX_NAME; |
| 287 |
|
289 |
|
| 288 |
if (config_getswitch(IMAPOPT_IMAPMAGICPLUS)) { |
290 |
if (config_getswitch(IMAPOPT_IMAPMAGICPLUS)) { |
| 289 |
/* make a working copy of the auth[z]id */ |
291 |
/* make a working copy of the auth[z]id */ |
|
Lines 345-350
Link Here
|
| 345 |
|
347 |
|
| 346 |
/* make a working copy of the authzid */ |
348 |
/* make a working copy of the authzid */ |
| 347 |
if (!rlen) rlen = strlen(requested_user); |
349 |
if (!rlen) rlen = strlen(requested_user); |
|
|
350 |
if (rlen > MAX_MAILBOX_NAME) |
| 351 |
rlen = MAX_MAILBOX_NAME; |
| 352 |
|
| 348 |
memcpy(userbuf, requested_user, rlen); |
353 |
memcpy(userbuf, requested_user, rlen); |
| 349 |
userbuf[rlen] = '\0'; |
354 |
userbuf[rlen] = '\0'; |
| 350 |
requested_user = userbuf; |
355 |
requested_user = userbuf; |
|
Lines 2349-2354
Link Here
|
| 2349 |
while (!r && c == ' ') { |
2354 |
while (!r && c == ' ') { |
| 2350 |
/* Grow the stage array, if necessary */ |
2355 |
/* Grow the stage array, if necessary */ |
| 2351 |
if (numstage == numalloc) { |
2356 |
if (numstage == numalloc) { |
|
|
2357 |
if (numalloc > INT_MAX/2) |
| 2358 |
exit(1); |
| 2352 |
numalloc *= 2; |
2359 |
numalloc *= 2; |
| 2353 |
stage = xrealloc(stage, numalloc * sizeof(struct appendstage *)); |
2360 |
stage = xrealloc(stage, numalloc * sizeof(struct appendstage *)); |
| 2354 |
} |
2361 |
} |
|
Lines 2770-2779
Link Here
|
| 2770 |
int binsize = 0; |
2777 |
int binsize = 0; |
| 2771 |
|
2778 |
|
| 2772 |
p = section = fetchatt.s + 7; |
2779 |
p = section = fetchatt.s + 7; |
| 2773 |
if (*p == 'P') { |
2780 |
if (!strncmp(p, "PEEK[", 5)) { |
| 2774 |
p = section += 5; |
2781 |
p = section += 5; |
| 2775 |
} |
2782 |
} |
| 2776 |
else if (*p == 'S') { |
2783 |
else if (!strncmp(p, "SIZE[", 5)) { |
| 2777 |
p = section += 5; |
2784 |
p = section += 5; |
| 2778 |
binsize = 1; |
2785 |
binsize = 1; |
| 2779 |
} |
2786 |
} |
|
Lines 2813-2819
Link Here
|
| 2813 |
else if (!strncmp(fetchatt.s, "BODY[", 5) || |
2820 |
else if (!strncmp(fetchatt.s, "BODY[", 5) || |
| 2814 |
!strncmp(fetchatt.s, "BODY.PEEK[", 10)) { |
2821 |
!strncmp(fetchatt.s, "BODY.PEEK[", 10)) { |
| 2815 |
p = section = fetchatt.s + 5; |
2822 |
p = section = fetchatt.s + 5; |
| 2816 |
if (*p == 'P') { |
2823 |
if (!strncmp(p, "PEEK[", 5)) { |
| 2817 |
p = section += 5; |
2824 |
p = section += 5; |
| 2818 |
} |
2825 |
} |
| 2819 |
else { |
2826 |
else { |
|
Lines 3154-3160
Link Here
|
| 3154 |
else if (!strncmp(data, "body[", 5) || |
3161 |
else if (!strncmp(data, "body[", 5) || |
| 3155 |
!strncmp(data, "body.peek[", 10)) { |
3162 |
!strncmp(data, "body.peek[", 10)) { |
| 3156 |
p = section = data + 5; |
3163 |
p = section = data + 5; |
| 3157 |
if (*p == 'p') { |
3164 |
if (!strncmp(p, "peek[", 5)) { |
| 3158 |
p = section += 5; |
3165 |
p = section += 5; |
| 3159 |
} |
3166 |
} |
| 3160 |
else { |
3167 |
else { |