]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Ensure that lines in the request which are too long are
authorJeff Trawick <trawick@apache.org>
Thu, 13 May 2004 23:40:03 +0000 (23:40 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 13 May 2004 23:40:03 +0000 (23:40 +0000)
properly terminated before logging.

Submitted by: Tsurutani Naoki <turutani scphys.kyoto-u.ac.jp>
Reviewed by: trawick, nd, bnicholes

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

CHANGES
STATUS
server/protocol.c

diff --git a/CHANGES b/CHANGES
index f5c84d1f46863720b6702ce8d69a3d8307e5d723..beda433892750e9f682a1d639165f1129b3dfdfc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.50
 
+  *) Ensure that lines in the request which are too long are 
+     properly terminated before logging.
+     [Tsurutani Naoki <turutani scphys.kyoto-u.ac.jp>]
+
   *) Update the bind credentials for the cached LDAP connection to 
      reflect the last bind.  This prevents util_ldap from creating 
      unnecessary connections rather than reusing cached connections.
diff --git a/STATUS b/STATUS
index c2fec1520003ebfdb7661408982422d650c86e6b..49cdfe979fdef4d50512e11216e1f6f006526f89 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/05/13 15:18:24 $]
+Last modified at [$Date: 2004/05/13 23:40:02 $]
 
 Release:
 
@@ -393,10 +393,6 @@ PATCHES TO BACKPORT FROM 2.1
       which integrates the two rounds of changes)
       +1 concept: trawick
 
-    * Make sure long request lines are '\0'-terminated. (PR 28376)
-      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/protocol.c?r1=1.147&r2=1.148
-      +1: trawick, nd, bnicholes
-
 CURRENT RELEASE NOTES:
 
     * Backwards compatibility is expected of future Apache 2.0 releases,
index 588dd6dd581759028857755414c787ca7846b60b..fbe6d0ed709634cdee311afe9b04c95b8fa524a4 100644 (file)
@@ -250,6 +250,15 @@ AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n,
         /* Would this overrun our buffer?  If so, we'll die. */
         if (n < bytes_handled + len) {
             *read = bytes_handled;
+            if (*s) {
+                /* ensure this string is terminated */
+                if (bytes_handled < n) {
+                    (*s)[bytes_handled] = '\0';
+                }
+                else {
+                    (*s)[n-1] = '\0';
+                }
+            }
             return APR_ENOSPC;
         }
 
@@ -380,6 +389,8 @@ AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n,
             /* Do we have enough space? We may be full now. */
                 if (bytes_handled >= n) {
                     *read = n;
+                    /* ensure this string is terminated */
+                    (*s)[n-1] = '\0';
                     return APR_ENOSPC;
                 }
                 else {