pingpong: reject nul byte in server response line

Add test 2108 covering the rejection over FTP. Drop the now-vestigial
nul bytes from test 1282; they exercised the removed Kerberos FTP
security buffer check and now trip this rejection before the 633
login-denied path is reached.

Closes #21996
This commit is contained in:
alhudz 2026-06-13 13:34:51 +05:30 committed by Daniel Stenberg
parent a7e35c9194
commit 2f8fb98c5f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 50 additions and 1 deletions

View file

@ -254,6 +254,7 @@ test2072 test2073 test2074 test2075 test2076 test2077 test2078 test2079 \
test2080 test2081 test2082 test2083 test2084 test2085 test2086 test2087 \
test2088 test2089 test2090 test2091 test2092 \
test2100 test2101 test2102 test2103 test2104 test2105 test2106 test2107 \
test2108 \
\
test2200 test2201 test2202 test2203 test2204 test2205 test2206 test2207 \
test2208 \

View file

@ -10,7 +10,7 @@ RETR
# Server-side
<reply>
<servercmd>
REPLY PASS 633 XXXXXXXX\x00\x00XXXXXXXX
REPLY PASS 633 XXXXXXXXXXXXXXXX
</servercmd>
</reply>

41
tests/data/test2108 Normal file
View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
FTP
</keywords>
</info>
# Server-side
<reply>
<servercmd>
REPLY PASS 230 logged\x00 in
</servercmd>
</reply>
# Client-side
<client>
<server>
ftp
</server>
<name>
FTP rejects a nul byte in a server response line
</name>
<command>
ftp://%HOSTIP:%FTPPORT/%TESTNUMBER
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol crlf="yes">
USER anonymous
PASS ftp@example.com
</protocol>
# 8 == CURLE_WEIRD_SERVER_REPLY
<errorcode>
8
</errorcode>
</verify>
</testcase>