Blame SOURCES/freeradius-talloc-dummy-request.patch

75e927
From 03c5915208234255484ece4c233c9e252776e3a3 Mon Sep 17 00:00:00 2001
75e927
From: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
75e927
Date: Mon, 29 Sep 2014 17:40:10 +0300
75e927
Subject: [PATCH 1/1] process: Talloc home_trigger dummy request
75e927
75e927
Allocate the dummy request in home_trigger with talloc, instead of
75e927
allocating it on the stack, as the rest of the code expects it to be a
75e927
valid talloc context.
75e927
75e927
This fixes a talloc_abort resulting from xlat_tokenize_request invoking
75e927
talloc_typed_strdup with the dummy request as the talloc context.
75e927
---
75e927
 src/main/process.c | 17 +++++++++--------
75e927
 1 file changed, 9 insertions(+), 8 deletions(-)
75e927
75e927
diff --git a/src/main/process.c b/src/main/process.c
75e927
index 76ce4ea..7e1a51e 100644
75e927
--- a/src/main/process.c
75e927
+++ b/src/main/process.c
75e927
@@ -3212,16 +3212,17 @@ static void ping_home_server(void *ctx)
75e927
 
75e927
 static void home_trigger(home_server_t *home, char const *trigger)
75e927
 {
75e927
-	REQUEST my_request;
75e927
-	RADIUS_PACKET my_packet;
75e927
+	REQUEST *my_request;
75e927
+	RADIUS_PACKET *my_packet;
75e927
 
75e927
-	memset(&my_request, 0, sizeof(my_request));
75e927
-	memset(&my_packet, 0, sizeof(my_packet));
75e927
-	my_request.proxy = &my_packet;
75e927
-	my_packet.dst_ipaddr = home->ipaddr;
75e927
-	my_packet.src_ipaddr = home->src_ipaddr;
75e927
+	my_request = talloc_zero(NULL, REQUEST);
75e927
+	my_packet = talloc_zero(my_request, RADIUS_PACKET);
75e927
+	my_request->proxy = my_packet;
75e927
+	my_packet->dst_ipaddr = home->ipaddr;
75e927
+	my_packet->src_ipaddr = home->src_ipaddr;
75e927
 
75e927
-	exec_trigger(&my_request, home->cs, trigger, false);
75e927
+	exec_trigger(my_request, home->cs, trigger, false);
75e927
+	talloc_free(my_request);
75e927
 }
75e927
 
75e927
 static void mark_home_server_zombie(home_server_t *home, struct timeval *now, struct timeval *response_window)
75e927
-- 
75e927
2.1.0
75e927