mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
mime: limit bas64-encoded lines length to 76 characters
This commit is contained in:
parent
2509395ecf
commit
a8742efe42
@ -406,7 +406,7 @@ static size_t encoder_base64_read(char *buffer, size_t size, bool ateof,
|
|||||||
|
|
||||||
while(st->bufbeg < st->bufend) {
|
while(st->bufbeg < st->bufend) {
|
||||||
/* Line full ? */
|
/* Line full ? */
|
||||||
if(st->pos >= MAX_ENCODED_LINE_LENGTH - 4) {
|
if(st->pos > MAX_ENCODED_LINE_LENGTH - 4) {
|
||||||
/* Yes, we need 2 characters for CRLF. */
|
/* Yes, we need 2 characters for CRLF. */
|
||||||
if(size < 2)
|
if(size < 2)
|
||||||
break;
|
break;
|
||||||
@ -421,7 +421,7 @@ static size_t encoder_base64_read(char *buffer, size_t size, bool ateof,
|
|||||||
if(size < 4 || st->bufend - st->bufbeg < 3)
|
if(size < 4 || st->bufend - st->bufbeg < 3)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Encode three bytes a four characters. */
|
/* Encode three bytes as four characters. */
|
||||||
i = st->buf[st->bufbeg++] & 0xFF;
|
i = st->buf[st->bufbeg++] & 0xFF;
|
||||||
i = (i << 8) | (st->buf[st->bufbeg++] & 0xFF);
|
i = (i << 8) | (st->buf[st->bufbeg++] & 0xFF);
|
||||||
i = (i << 8) | (st->buf[st->bufbeg++] & 0xFF);
|
i = (i << 8) | (st->buf[st->bufbeg++] & 0xFF);
|
||||||
|
@ -66,8 +66,8 @@ This is the e-mail inline text with a very long line containing the special=
|
|||||||
Content-Disposition: attachment; filename="test648.txt"
|
Content-Disposition: attachment; filename="test648.txt"
|
||||||
Content-Transfer-Encoding: base64
|
Content-Transfer-Encoding: base64
|
||||||
|
|
||||||
VGhpcyBpcyBhbiBhdHRhY2hlZCBmaWxlLgoKSXQgbWF5IGNvbnRhaW4gYW55IHR5cGUgb2Yg
|
VGhpcyBpcyBhbiBhdHRhY2hlZCBmaWxlLgoKSXQgbWF5IGNvbnRhaW4gYW55IHR5cGUgb2YgZGF0
|
||||||
ZGF0YSBhbmQgd2lsbCBiZSBlbmNvZGVkIGluIGJhc2U2NCBmb3IgdHJhbnNmZXIuCg==
|
YSBhbmQgd2lsbCBiZSBlbmNvZGVkIGluIGJhc2U2NCBmb3IgdHJhbnNmZXIuCg==
|
||||||
--------------------------------
|
--------------------------------
|
||||||
.
|
.
|
||||||
</upload>
|
</upload>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user