Hi
The agent's engine_id forgot to dup from trash, all engine_ids point to the
same address "&trash.area", the engine_id changed at run time and will
double-free when release agents and trash.

Kevin
From 674ba1e318cb561a1650db98030e12939e604171 Mon Sep 17 00:00:00 2001
From: Kevin Zhu <ipand...@gmail.com>
Date: Fri, 13 Mar 2020 10:39:51 +0800
Subject: [PATCH] BUG/MEDIUM: spoe: dup agent's engine_id string from
 trash.area

The agent's engine_id forgot to dup from trash, all engine_ids point to
the same address "&trash.area", the engine_id changed at run time and will
double free when release agents and trash.
---
 src/flt_spoe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index df080d8..57c2246 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -258,7 +258,7 @@ static char *
 generate_pseudo_uuid()
 {
 	ha_generate_uuid(&trash);
-	return trash.area;
+	return my_strndup(trash.area, trash.data);
 }
 
 
-- 
2.7.4

Reply via email to