xcir / libvmod-parsereq

This project is deprecated

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with multipart forms and NUL character

diegosuarez opened this issue · comments

Hello,

We have a little issue with multipart forms. With only the import of the parsereq and the use of "parsereq.init();" and nothing more, our origins are getting a "\0" (NUL char) after all chunks of multipart body data: we're getting something like

-----------------------------1604889593984783231595295988
Content-Disposition: form-data; name="option"

com_facileforms\0
-----------------------------1604889593984783231595295988
Content-Disposition: form-data; name="Itemid"

my-form-content\0
-----------------------------1604889593984783231595295988

The expected behaviour would be to get a CR +LF, instead of a NUL+LF. The \0 is not visible, I included it for clarity, after seeing it in a hexdump of the request in the origin.

Varnish version is 3.0.5 and libvmod-parsereq is the latest commit on master.

Do you have any idea of what could be happening?
Thanks and regards.

Hello,

We've tried to fix this issue commenting the line 793 of vmod_parsereq_core.c:

//     p_body_end[0] = 0;

It appears to solve the problem, and we haven't detected any side effects of it.