#80 ✓resolved
Derek Kastner

Multipart parsing bug when field body ends at same point as end of buffer

Reported by Derek Kastner | November 16th, 2009 @ 08:21 PM | in 1.1

There was a problem with the multipart form data parser that would cause the parser to drop some fields if a field's data ended at the same point as the end of the buffer. In essence, at the end of the parsing loop, the loop was broken if the buffer was empty instead of looping again for more data.

Bosko Milekic had submitted a fix for the issue, but we found his fix introduced another bug. Our own fix and a test of that fix are on our own fork of Bosko's fix.

Bosko's fix: http://github.com/bloom/rack/commit/8f4bfced74e7a07d0f0f47705b763c7...
Our fix: http://github.com/gdi/rack/commit/608e4b9870a0f0ec19fc3517c06c9ef2d...

While Bosko's fix checked for the end of a field that coincides with the end of the buffer, his code was not saving the field to the list of params. Our code inserts the current field into the list of params, then continues the loop, looking for more data.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket