From d795ada96dc7221b756f905d6fd97f3ea069758b Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 15 Sep 2004 10:47:56 +0000 Subject: [PATCH] Backport from HEAD: * server/protocol.c (ap_rgetline_core): Fix off-by-one. Reviewed by: jerenkrantz, trawick git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@105127 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 +----- server/protocol.c | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/STATUS b/STATUS index 93b548a4786..fc1f910b94a 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2004/09/15 10:31:16 $] +Last modified at [$Date: 2004/09/15 10:47:56 $] Release: @@ -73,10 +73,6 @@ PATCHES TO BACKPORT FROM 2.1 [ please place file names and revisions from HEAD here, so it is easy to identify exactly what the proposed changes are! ] - *) ap_rgetline_core correctness fix. - http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/protocol.c?r1=1.151&r2=1.152 - +1: jorton, jerenkrantz, trawick - *) mod_rewrite: Fix 0 bytes write into random memory position. PR 31036. (2.0 + 1.3) http://www.apache.org/~nd/dbmmap_1.3.patch diff --git a/server/protocol.c b/server/protocol.c index 82b95f3ca4a..028bcb9beee 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -253,7 +253,7 @@ AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, if (*s) { /* ensure this string is terminated */ if (bytes_handled < n) { - (*s)[bytes_handled] = '\0'; + (*s)[bytes_handled-1] = '\0'; } else { (*s)[n-1] = '\0'; -- 2.47.2