]> granicus.if.org Git - apache/commitdiff
Merge 1436401 from trunk:
authorJoe Orton <jorton@apache.org>
Tue, 22 Jan 2013 11:50:45 +0000 (11:50 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 22 Jan 2013 11:50:45 +0000 (11:50 +0000)
* support/htcacheclean.c (main): Ensure -p was used before attempting
  to process URL arguments.

Reviewed by: jorton, rpluem, rjung

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1436846 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
support/htcacheclean.c

diff --git a/CHANGES b/CHANGES
index cadc8ed2b87a5c3e368bcf2542176409b7d8f06c..92e47029ea6713c7afbaff84479fa516fdf377bf 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 
 Changes with Apache 2.4.4
 
+  *) htcacheclean: Fix potential segfault if "-p" is omitted.  [Joe Orton]
+
   *) mod_proxy_http: Honour special value 0 (unlimited) of LimitRequestBody
      PR 54435.  [Pavel Mateja <pavel netsafe.cz>]
 
index f093410ca1fab4a7fa54e0c0c1d3008f4a0a6a78..4150936fbbb8a86db367061b94c51190a345a47e 100644 (file)
@@ -1620,6 +1620,10 @@ int main(int argc, const char * const argv[])
         usage(NULL);
     }
 
+    if (!proxypath) {
+         usage("Option -p must be specified");
+    }
+
     if (o->ind < argc) {
         int deleted = 0;
         int error = 0;
@@ -1671,10 +1675,6 @@ int main(int argc, const char * const argv[])
          usage("Option -i cannot be used without -d");
     }
 
-    if (!proxypath) {
-         usage("Option -p must be specified");
-    }
-
     if (!listurls && max <= 0 && inodes <= 0) {
          usage("At least one of option -l or -L must be greater than zero");
     }