Project

General

Profile

Actions

Bug #3160

closed

Wrong buffer size in function buffer_substr_replace() in file buffer.c

Added by k.trempala almost 2 years ago. Updated almost 2 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:
No

Description

In function buffer_substr_replace(), the buffer is inappropriately increased by the buffer_extend() functions.

Previously in version 1.4.59 it was:

buffer_string_set_length(b, blen-len+rlen);

As of version 1.4.60 it is (It's bad):

buffer_extend(b, blen-len+rlen);

The buffer_extend() function increases the buffer (it does not set the size as in the previous function buffer_string_set_length()) and it should be:

buffer_extend(b, rlen-len);

The error occurred when using mod_proxy with the configuration:

proxy.header = (
    "map-urlpath" => (
    "/proxy/switch/b0:b3:2b:00:e2:6b/" => "/",
    "/proxy/switch/b0:b3:2b:00:e2:6b" => "/" 
    )
  )

Actions #1

Updated by gstrauss almost 2 years ago

ick. Thank you for reporting this. Your suggested patch appears correct at first glance.

I need to write some tests to cover this.

Actions #2

Updated by gstrauss almost 2 years ago

  • Status changed from New to Patch Pending
Actions #3

Updated by gstrauss almost 2 years ago

  • Status changed from Patch Pending to Fixed
Actions

Also available in: Atom