Re: parsing quoted-string HTTP header fields

2011-05-31 Thread Tsantilas Christos
On 05/31/2011 07:30 PM, Alex Rousskov wrote: On Tue, 31 May 2011, Amos Jeffries wrote: On 31/05/11 01:40, Tsantilas Christos wrote: This is the third patch. In this patch also solved a small buffer overread which exist in the original httpHeaderParseQuotedString function. The loop: while (

Re: parsing quoted-string HTTP header fields

2011-05-31 Thread Alex Rousskov
On Tue, 31 May 2011, Amos Jeffries wrote: On 31/05/11 01:40, Tsantilas Christos wrote: This is the third patch. In this patch also solved a small buffer overread which exist in the original httpHeaderParseQuotedString function. The loop: while (end <= (start+len) && *end != '\\' && *end !=

Re: parsing quoted-string HTTP header fields

2011-05-30 Thread Amos Jeffries
On 31/05/11 01:40, Tsantilas Christos wrote: This is the third patch. In this patch also solved a small buffer overread which exist in the original httpHeaderParseQuotedString function. The loop: while (end <= (start+len) && *end != '\\' && *end != '\"' && *end > 0x1F && *end != 0x7F) if (*end

Re: parsing quoted-string HTTP header fields

2011-05-30 Thread Tsantilas Christos
This is the third patch. In this patch also solved a small buffer overread which exist in the original httpHeaderParseQuotedString function. The loop: while (end <= (start+len) && *end != '\\' && *end != '\"' && *end > 0x1F && *end != 0x7F) if (*end <= 0x1F || *end == 0x7F) { ... allowe

Re: parsing quoted-string HTTP header fields

2011-05-27 Thread Amos Jeffries
On 27/05/11 23:21, Tsantilas Christos wrote: Hi all, Just trying to clarify what we want to implement at the end, because I am confused. I am responsible for the confusion because I give two "(3)" options, and I send buggy implementations for the "(1)" and the "second (3)" option. From what I

Re: parsing quoted-string HTTP header fields

2011-05-27 Thread Tsantilas Christos
Hi all, Just trying to clarify what we want to implement at the end, because I am confused. I am responsible for the confusion because I give two "(3)" options, and I send buggy implementations for the "(1)" and the "second (3)" option. From what I can understand, currently, we have the fo

Re: parsing quoted-string HTTP header fields

2011-05-27 Thread Tsantilas Christos
On 05/26/2011 11:13 PM, Alex Rousskov wrote: On 05/26/2011 10:20 AM, Amos Jeffries wrote: Implementation: while (*pos != '"'&& len> (pos-start)) { + +if (*pos =='\r') { +pos ++; +if (*(pos++) != '\n' || (*pos != ' '&& *pos != '\t')) { Can the ab

Re: parsing quoted-string HTTP header fields

2011-05-26 Thread Tsantilas Christos
On 05/26/2011 11:38 PM, Alex Rousskov wrote: On 05/26/2011 10:23 AM, Tsantilas Christos wrote: Can the above double increment lead to *pos pointing beyond the string boundaries? Yes it can, but we do not care because we do not modifying anything but we are _reading_ those values. I guess the

Re: parsing quoted-string HTTP header fields

2011-05-26 Thread Alex Rousskov
On 05/26/2011 10:23 AM, Tsantilas Christos wrote: >> Can the above double increment lead to *pos pointing beyond the string >> boundaries? > > Yes it can, but we do not care because we do not modifying anything but we are _reading_ those values. I guess there is an undocumented assumption that th

Re: parsing quoted-string HTTP header fields

2011-05-26 Thread Alex Rousskov
On 05/26/2011 10:20 AM, Amos Jeffries wrote: > while (end <= (start+len) && *end != '\\' && *end != '\"' && *end > > 0x1F && *end != 0x7F) > end++; > -if (*end <= 0x1F || *end == 0x7F) { > +if ((*end <= 0x1F && *end != '\r') || *end == 0x7F) { >

Re: parsing quoted-string HTTP header fields

2011-05-26 Thread Alex Rousskov
On 05/26/2011 10:20 AM, Amos Jeffries wrote: >> >> Implementation: >> >>> while (*pos != '"'&& len> (pos-start)) { >>> + >>> +if (*pos =='\r') { >>> +pos ++; >>> +if (*(pos++) != '\n' || (*pos != ' '&& *pos != '\t')) { >> >> Can the above double increment l

Re: parsing quoted-string HTTP header fields

2011-05-26 Thread Tsantilas Christos
On 05/26/2011 06:01 PM, Alex Rousskov wrote: On 05/26/2011 06:14 AM, Amos Jeffries wrote: On 26/05/11 19:02, Tsantilas Christos wrote: On 05/26/2011 07:42 AM, Amos Jeffries wrote: On Wed, 25 May 2011 20:07:13 +0300, Tsantilas Christos wrote: The second patch does not look slower, but maybe we

Re: parsing quoted-string HTTP header fields

2011-05-26 Thread Amos Jeffries
On 27/05/11 03:01, Alex Rousskov wrote: On 05/26/2011 06:14 AM, Amos Jeffries wrote: On 26/05/11 19:02, Tsantilas Christos wrote: On 05/26/2011 07:42 AM, Amos Jeffries wrote: On Wed, 25 May 2011 20:07:13 +0300, Tsantilas Christos wrote: The second patch does not look slower, but maybe we do n

Re: parsing quoted-string HTTP header fields

2011-05-26 Thread Alex Rousskov
On 05/26/2011 06:14 AM, Amos Jeffries wrote: > On 26/05/11 19:02, Tsantilas Christos wrote: >> On 05/26/2011 07:42 AM, Amos Jeffries wrote: >>> On Wed, 25 May 2011 20:07:13 +0300, Tsantilas Christos wrote: The second patch does not look slower, but maybe we do not want to be strict for ma

Re: parsing quoted-string HTTP header fields

2011-05-26 Thread Amos Jeffries
On 26/05/11 19:02, Tsantilas Christos wrote: On 05/26/2011 07:42 AM, Amos Jeffries wrote: On Wed, 25 May 2011 20:07:13 +0300, Tsantilas Christos wrote: Here are two patches the first implements the (1) and the second the (3). Attach? oops! Now attsached. The second patch does not look sl

Re: parsing quoted-string HTTP header fields

2011-05-26 Thread Tsantilas Christos
On 05/26/2011 07:42 AM, Amos Jeffries wrote: On Wed, 25 May 2011 20:07:13 +0300, Tsantilas Christos wrote: Here are two patches the first implements the (1) and the second the (3). Attach? oops! Now attsached. The second patch does not look slower, but maybe we do not want to be strict fo

Re: parsing quoted-string HTTP header fields

2011-05-25 Thread Amos Jeffries
On Wed, 25 May 2011 20:07:13 +0300, Tsantilas Christos wrote: Here are two patches the first implements the (1) and the second the (3). Attach? The second patch does not look slower, but maybe we do not want to be strict for many reasons. One reason is that this function used to "Configurable

Re: parsing quoted-string HTTP header fields

2011-05-25 Thread Tsantilas Christos
Here are two patches the first implements the (1) and the second the (3). The second patch does not look slower, but maybe we do not want to be strict for many reasons. One reason is that this function used to "Configurable SSL error details messages" patch, to parse the "descr:" and "detail:"

Re: parsing quoted-string HTTP header fields

2011-05-25 Thread Amos Jeffries
On 25/05/11 22:44, Tsantilas Christos wrote: The quoted string fields parsing done in squid3 using the httpHeaderParseQuotedString function (HttpHeaderTools.cc file) I found that we do not support multiline quoted string fields, but according the rfc2616 multiline quoted string fields should sup

parsing quoted-string HTTP header fields

2011-05-25 Thread Tsantilas Christos
The quoted string fields parsing done in squid3 using the httpHeaderParseQuotedString function (HttpHeaderTools.cc file) I found that we do not support multiline quoted string fields, but according the rfc2616 multiline quoted string fields should supported: quoted-string = ( <"> *(qdtext