Project

General

Profile

Actions

Bug #3160

closed

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

Added by k.trempala about 1 month ago. Updated 30 days 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 about 1 month 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 30 days ago

  • Status changed from New to Patch Pending
Actions #3

Updated by gstrauss 30 days ago

  • Status changed from Patch Pending to Fixed
Actions

Also available in: Atom