From f5ad1a54ca56c8d6e7de9c191b2f4cb0239d6d28 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 14 Sep 2009 19:17:16 +0000 Subject: [PATCH] * modules/proxy/mod_proxy_ftp.c (parse_epsv_reply): Remove redundant check for !p[0], thanks rpluem. Also update to take const argument and fix comment, since the string is not modified in-place. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@814785 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/mod_proxy_ftp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c index dfe3cade5b..b56d0002aa 100644 --- a/modules/proxy/mod_proxy_ftp.c +++ b/modules/proxy/mod_proxy_ftp.c @@ -683,18 +683,18 @@ static apr_status_t proxy_send_dir_filter(ap_filter_t *f, return APR_SUCCESS; } -/* Parse EPSV reply and return port, or zero on error. Modifies - * 'reply'. */ -static apr_port_t parse_epsv_reply(char *reply) +/* Parse EPSV reply and return port, or zero on error. */ +static apr_port_t parse_epsv_reply(const char *reply) { - char *p, *ep; + const char *p; + char *ep; long port; /* Reply syntax per RFC 2428: "229 blah blah (|||port|)" where '|' * can be any character in ASCII from 33-126, obscurely. Verify * the syntax. */ - p = ap_strchr(reply, '('); - if (p == NULL || !p[0] || !p[1] || p[1] != p[2] || p[1] != p[3] + p = ap_strchr_c(reply, '('); + if (p == NULL || !p[1] || p[1] != p[2] || p[1] != p[3] || p[4] == p[1]) { return 0; } -- 2.40.0