gopher: reject CR and LF in the selector

Verifed in test 1609

Closes #22116
This commit is contained in:
alhudz 2026-06-20 15:02:19 +05:30 committed by Daniel Stenberg
parent d786a85f19
commit 65d8eaeaa2
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 49 additions and 1 deletions

38
tests/data/test1609 Normal file
View file

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
GOPHER
CRLF-in-URL
</keywords>
</info>
# Server-side
<reply>
</reply>
# Client-side
<client>
<server>
gopher
</server>
<name>
Gopher with URL-encoded CR LF in the selector
</name>
<command>
gopher://%HOSTIP:%GOPHERPORT/1/sel%0d%0aINJECT/%TESTNUMBER
</command>
</client>
# Verify data after the test has been "shot"
<verify>
# 3 - CURLE_URL_MALFORMAT
<errorcode>
3
</errorcode>
# nothing must reach the server, the selector is rejected before any send
<protocol nonewline="yes">
</protocol>
</verify>
</testcase>