]> granicus.if.org Git - apache/commitdiff
* modules/proxy/mod_proxy_ftp.c (parse_epsv_reply): Remove redundant
authorJoe Orton <jorton@apache.org>
Mon, 14 Sep 2009 19:17:16 +0000 (19:17 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 14 Sep 2009 19:17:16 +0000 (19:17 +0000)
  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

index dfe3cade5bfe1f932ef673ec0ef008f598ff62f8..b56d0002aa8f1ee9c05f78deccfb5a32ddfaf955 100644 (file)
@@ -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;
     }