Skip to content

Incorrect EOF handling with "-F field=<-" #1281

@shachaf

Description

@shachaf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions