To reproduce: Run curl -F 'field=<-' 'http://example.com/', then type "abc\n" and press ^D; curl will continue waiting for input until you press ^D a second time.
The bug is caused by the use of fread() in Curl_getformdata() (code at the time of writing). In the example above, fread() will return 4 after the first call, even at EOF. To handle EOF correctly, the code should check feof() explicitly.
The text was updated successfully, but these errors were encountered:
True. But what errors could that really be when reading from stdin that don't also end the stream? I suppose it won't do any harm to check for them too, but I'm thinking we ignore the error and use the read data up until that point anyway...