libvmod-parsereq icon indicating copy to clipboard operation
libvmod-parsereq copied to clipboard

Issue with multipart forms and NUL character

Open diegosuarez opened this issue 10 years ago • 1 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.

diegosuarez avatar Jul 16 '14 13:07 diegosuarez

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.

diegosuarez avatar Jul 21 '14 12:07 diegosuarez