]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: spoe: dup agent's engine_id string from trash.area
authorKevin Zhu <ipandtcp@gmail.com>
Fri, 13 Mar 2020 02:39:51 +0000 (10:39 +0800)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 16 Mar 2020 16:35:30 +0000 (17:35 +0100)
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.

This bug was introduced by the commit ee3bcddef ("MINOR: tools: add a generic
function to generate UUIDs").

No backport is needed, this is 2.2-dev.

src/flt_spoe.c

index df080d81666a8fbb0b5d400a5c3081b71d211f22..57c22464475b968939db784ecef420da5fd7ccf0 100644 (file)
@@ -258,7 +258,7 @@ static char *
 generate_pseudo_uuid()
 {
        ha_generate_uuid(&trash);
-       return trash.area;
+       return my_strndup(trash.area, trash.data);
 }