forked from pool/haproxy
0001-BUG-MAJOR-fix-listening-IP-address-storage-for-front.patch 0002-BUG-MINOR-fix-listening-IP-address-storage-for-front.patch 0003-DOC-Fix-typo-so-fetch-is-properly-parsed-by-Cyril-s-.patch 0004-BUG-MAJOR-http-fix-breakage-of-reqdeny-causing-rando.patch 0005-BUG-MEDIUM-stick-tables-fix-breakage-in-table-conver.patch 0006-BUG-MEDIUM-dns-unbreak-DNS-resolver-after-header-fix.patch 0007-BUILD-fix-build-on-Solaris-11.patch 0008-CLEANUP-connection-fix-double-negation-on-memcmp.patch 0009-BUG-MEDIUM-stats-show-servers-state-may-show-an-serv.patch 0010-BUG-MEDIUM-fix-risk-of-segfault-with-show-tls-keys.patch 0011-BUG-MEDIUM-sticktables-segfault-in-some-configuratio.patch 0012-BUG-MEDIUM-lua-converters-doesn-t-work.patch 0013-BUG-MINOR-http-add-header-header-name-copied-twice.patch 0014-BUG-MEDIUM-http-add-header-buffer-overwritten.patch OBS-URL: https://build.opensuse.org/package/show/server:http/haproxy?expand=0&rev=129
52 lines
1.7 KiB
Diff
52 lines
1.7 KiB
Diff
From 4693e2302271252044038c9be38487fb16218e5b Mon Sep 17 00:00:00 2001
|
|
From: Thierry Fournier <thierry.fournier@ozon.io>
|
|
Date: Mon, 6 Jun 2016 18:28:05 +0200
|
|
Subject: [PATCH 11/14] BUG/MEDIUM: sticktables: segfault in some configuration
|
|
error cases
|
|
|
|
When a stick table is tracked, and another one is used later on the
|
|
configuration, a segfault occurs.
|
|
|
|
The function "smp_create_src_stkctr" can return a NULL value, and
|
|
its value is not tested, so one other function try to dereference
|
|
a NULL pointer. This patch just add a verification of the NULL
|
|
pointer.
|
|
|
|
The problem is reproduced with this configuration:
|
|
|
|
listen www
|
|
mode http
|
|
bind :12345
|
|
tcp-request content track-sc0 src table IPv4
|
|
http-request allow if { sc0_inc_gpc0(IPv6) gt 0 }
|
|
server dummy 127.0.0.1:80
|
|
backend IPv4
|
|
stick-table type ip size 10 expire 60s store gpc0
|
|
backend IPv6
|
|
stick-table type ipv6 size 10 expire 60s store gpc0
|
|
|
|
Thank to kabefuna@gmail.com for the bug report.
|
|
|
|
This patch must be backported in the 1.6 and 1.5 version.
|
|
(cherry picked from commit 6fc340ff07171bb85d11d835fa4158bbdef240a0)
|
|
---
|
|
src/stream.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/stream.c b/src/stream.c
|
|
index 4ba8010..d80efa5 100644
|
|
--- a/src/stream.c
|
|
+++ b/src/stream.c
|
|
@@ -2855,7 +2855,7 @@ smp_fetch_sc_inc_gpc0(const struct arg *args, struct sample *smp, const char *kw
|
|
if (stkctr_entry(stkctr) == NULL)
|
|
stkctr = smp_create_src_stkctr(smp->sess, smp->strm, args, kw);
|
|
|
|
- if (stkctr_entry(stkctr) != NULL) {
|
|
+ if (stkctr && stkctr_entry(stkctr)) {
|
|
void *ptr1,*ptr2;
|
|
|
|
/* First, update gpc0_rate if it's tracked. Second, update its
|
|
--
|
|
2.6.6
|
|
|