curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: nul bytes in form field names

From: Patrick Monnerat via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 20 Sep 2017 01:05:06 +0100

On 09/19/2017 11:18 PM, Daniel Stenberg wrote:
>> Please note this will affect the form API compatibility.
>
> Mostly theoretically, right? I mean the old API didn't really send
> names properly with embedded zeroes either, did it?
I never tested it in real conditions, but considering the now defunct
_FORM_DEBUG code, it probably worked some day.
I'll reject names with embedded null bytes (CURL_FORMADD_NULL) in
curl_formadd(). Then document this deviance.
>
>> Do we keep the length parameter for names or suppress it and require
>> names are always nul-terminated ?
>
> I vote for requiring nul termination, just to make the API a little
> bit simpler.
Agreed. Thanks for hints and advice.

>
>> The only place I've ever seen it is in the pre Apr 2011 formdata.c
>> _FORM_DEBUG enabled code :-)
>
> I don't think we should count that as real use! =)
This was just a Precambrian code reference (the earth was still flat at
this time !)

Patrick
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-09-20