count single \r or \n as \r\n while checking line length against MAXHEADERSIZE

Florian Schlichting fschlich at CIS.FU-Berlin.DE
Mon Oct 25 14:17:04 UTC 2010


Hi Julien,

> That's not exact:
> * "p - q" is not the lenght of a line;

> +    for (q = p; (p = strchr(p, '\n')) != NULL; p++) {
> +        /* Note that '\r\n' has temporarily been internally replaced by '\n'.
> +         * Therefore, the count takes it into account. */
> +        if (p - q + 2 > MAXARTLINELENGTH) {

I'm not too familiar with nnrpd; but on first sight, if \r\n is replaced
by a single \n as you write, shouldn't that be +1 instead of +2?

> * q is not updated when there is a continuation line.

obviously, yes, how could I overlook that!

Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5557 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/inn-workers/attachments/20101025/0e1ec534/attachment.bin>


More information about the inn-workers mailing list