From 4c34af4c99d4e7385e341f5fe65cb42549ada152 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 4 Jan 2020 11:41:35 +0100 Subject: curl -w: handle a blank input file correctly Previously it would end up with an uninitialized memory buffer that would lead to a crash or junk getting output. Added test 1271 to verify. Reported-by: Brian Carpenter Closes #4786 --- tests/data/test1271 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/data/test1271 (limited to 'tests/data/test1271') diff --git a/tests/data/test1271 b/tests/data/test1271 new file mode 100644 index 000000000..687a6a979 --- /dev/null +++ b/tests/data/test1271 @@ -0,0 +1,48 @@ + + + +HTTP +HTTP GET +--write-out + + + +# Server-side + + +HTTP/1.1 200 This is a weirdo text message swsclose +Content-Length: 4 +Connection: close + +Moo + + + +# Client-side + + +http + + +--write-out from file with empty file + + +http://%HOSTIP:%HTTPPORT/we/want/our/1271 -w @log/blank1271 + + + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /we/want/our/1271 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + -- cgit v1.2.3