]> granicus.if.org Git - apache/commitdiff
reject overlong credentials from the commandline
authorAndré Malo <nd@apache.org>
Mon, 21 Jul 2003 11:41:01 +0000 (11:41 +0000)
committerAndré Malo <nd@apache.org>
Mon, 21 Jul 2003 11:41:01 +0000 (11:41 +0000)
Acked by: Cliff Woolley

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100718 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
support/ab.c

diff --git a/CHANGES b/CHANGES
index 00aba08b89a809a106780b58734d10af7dbc371f..0124d822ddb58f9487721ba8c6df43fc365ac011 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) ab: Overlong credentials given via command line no longer clobber
+     the buffer. [André Malo]
+
   *) mod_rewrite: Ignore RewriteRules in .htaccess files if the directory
      containing the .htaccess file is requested without a trailing slash.
      PR 20195.  [André Malo]
index 059f4c2fc00d9dc74407f89f34267e7ca3761537..dd19510b0ec126a568c34930788b67a5dcc0db89 100644 (file)
@@ -1793,14 +1793,14 @@ static void test(void)
 static void copyright(void)
 {
     if (!use_html) {
-       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.126 $> apache-2.0");
+       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.127 $> apache-2.0");
        printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
        printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n");
        printf("\n");
     }
     else {
        printf("<p>\n");
-       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.126 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.127 $");
        printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
        printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
        printf("</p>\n<p>\n");
@@ -2086,6 +2086,9 @@ int main(int argc, const char * const argv[])
             */
            while (apr_isspace(*optarg))
                optarg++;
+            if (apr_base64_encode_len(strlen(optarg)) > sizeof(tmp)) {
+                err("Authentication credentials too long\n");
+            }
            l = apr_base64_encode(tmp, optarg, strlen(optarg));
            tmp[l] = '\0';
 
@@ -2098,6 +2101,9 @@ int main(int argc, const char * const argv[])
              */
            while (apr_isspace(*optarg))
                optarg++;
+            if (apr_base64_encode_len(strlen(optarg)) > sizeof(tmp)) {
+                err("Proxy credentials too long\n");
+            }
            l = apr_base64_encode(tmp, optarg, strlen(optarg));
            tmp[l] = '\0';