tool_getparam: clear argument only when needed

Test 699 verifies

Reported-by: bsr13 on hackerone
Closes #17112
This commit is contained in:
Daniel Stenberg 2025-04-15 17:27:47 +02:00
parent 929c9a7ef7
commit da9494eef0
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 62 additions and 4 deletions

57
tests/data/test699 Normal file
View file

@ -0,0 +1,57 @@
<testcase>
<info>
<keywords>
HTTP
--config
</keywords>
</info>
#
# Server-side
<reply>
<data crlf="yes">
HTTP/1.1 200 OK
Date: Tue, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes
-foo-
</data>
</reply>
#
# Client-side
<client>
<server>
http
</server>
<name>
--config with single-letter options plus one that is cleared
</name>
<file name="%LOGDIR/cmd">
-Lfuhej:you
</file>
<command>
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -K %LOGDIR/cmd
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<protocol crlf="yes">
GET /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Basic aGVqOnlvdQ==
User-Agent: curl/%VERSION
Accept: */*
</protocol>
</verify>
</testcase>