]> git.ipfire.org Git - thirdparty/strongswan.git/commit
child-create: Fix double free of list of labels after migrate
authorRob Shearman <rob@graphiant.com>
Thu, 14 Nov 2024 13:15:36 +0000 (13:15 +0000)
committerTobias Brunner <tobias@strongswan.org>
Thu, 5 Dec 2024 07:47:52 +0000 (08:47 +0100)
commitcaf81bc05c91b84e3b24cb3576cf00d966244053
tree2422d7da84d3fbe0d61f6030717894b360cc2d80
parentc8f16d18d8f42790e9bfeb12735526e2afe00bbe
child-create: Fix double free of list of labels after migrate

If a migrate of a child-create occurs then labels_i and labels_r are
freed, but the pointers are left set. If the task is subsequently
destroyed without being reused, then both of these will be double
freed.

Fix this by setting labels_i and labels_r to NULL in the migrate
method after freeing, similar to other fields that are freed.

Closes strongswan/strongswan#2552

Fixes: f9b895b49f49 ("child-create: Add support to handle security labels")
src/libcharon/sa/ikev2/tasks/child_create.c