]> granicus.if.org Git - apache/commitdiff
cause a lookup failure in external rewrite maps if
authorAndré Malo <nd@apache.org>
Tue, 29 Jul 2003 01:14:17 +0000 (01:14 +0000)
committerAndré Malo <nd@apache.org>
Tue, 29 Jul 2003 01:14:17 +0000 (01:14 +0000)
the key contains a newline.

PR: 14453
Submitted originally by: Cedric Gavage <cedric.gavage@unixtech.be>

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

CHANGES
modules/mappers/mod_rewrite.c

diff --git a/CHANGES b/CHANGES
index 50c95abcc3a1bd1e589e5425f482035675c33e1a..8f0ef853b500c944ef9f59a77e49e0f354c01180 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) mod_rewrite: In external rewrite maps lookup keys containing
+     a newline now cause a lookup failure. PR 14453.
+     [Cedric Gavage <cedric.gavage@unixtech.be>, André Malo]
+
   *) Install config.nice into the build/ directory to make
      minor version upgrades easier. [Joshua Slive]
 
index 437c0e55bba963f89ed5bd0f9ce3f1d6342bb0a8..71376ad016dde28600c298e17d8d76e737da191f 100644 (file)
@@ -1290,8 +1290,13 @@ static char *lookup_map_program(request_rec *r, apr_file_t *fpin,
      * context then the rewritemap-programs were not spawned.
      * In this case using such a map (usually in per-dir context)
      * is useless because it is not available.
+     *
+     * newlines in the key leave bytes in the pipe and cause
+     * bad things to happen (next map lookup will use the chars
+     * after the \n instead of the new key etc etc - in other words,
+     * the Rewritemap falls out of sync with the requests).
      */
-    if (fpin == NULL || fpout == NULL) {
+    if (fpin == NULL || fpout == NULL || ap_strchr(key, '\n')) {
         return NULL;
     }