summaryrefslogtreecommitdiff
path: root/networking/parse_pasv_epsv.c
diff options
context:
space:
mode:
authorDenys Vlasenko2020-07-19 20:59:35 +0200
committerDenys Vlasenko2020-07-19 20:59:35 +0200
commit06a407c6283b06307854649e522729a839017401 (patch)
treed4b18759e64f1559c9198b5f17d819b99916f11d /networking/parse_pasv_epsv.c
parent79a4032eefe405a1e7d4a644614fcc4a07b98d88 (diff)
downloadbusybox-06a407c6283b06307854649e522729a839017401.zip
busybox-06a407c6283b06307854649e522729a839017401.tar.gz
networking: support ftp PASV responses not ending with ')'
Patch by Baruch Burstein <bmburstein@gmail.com> function old new delta parse_pasv_epsv 153 181 +28 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/parse_pasv_epsv.c')
-rw-r--r--networking/parse_pasv_epsv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/networking/parse_pasv_epsv.c b/networking/parse_pasv_epsv.c
index 14f4d42..314237b 100644
--- a/networking/parse_pasv_epsv.c
+++ b/networking/parse_pasv_epsv.c
@@ -38,6 +38,8 @@ int FAST_FUNC parse_pasv_epsv(char *buf)
* Server's IP is N1.N2.N3.N4 (we ignore it)
* Server's port for data connection is P1*256+P2 */
ptr = strrchr(buf, ')');
+ if (!ptr) ptr = strrchr(buf, '\r'); /* for PASV responses not ending with ')' */
+ if (!ptr) ptr = strrchr(buf, '\n'); /* for PASV responses not ending with ')' */
if (ptr) *ptr = '\0';
ptr = strrchr(buf, ',');