service: fix use-after-free on service data update
authorJo-Philipp Wich <[email protected]>
Tue, 16 Sep 2025 15:12:14 +0000 (17:12 +0200)
committerJo-Philipp Wich <[email protected]>
Tue, 16 Sep 2025 15:12:14 +0000 (17:12 +0200)
commitace5f272e139b5b1f98e992b2590ed1384e2774e
treeffbcf85e575a20bc9ad37780c0c49ce87e580b17
parentdafdf98b03bfa6014cd94ffc86de130b9deb17e4
service: fix use-after-free on service data update

When updating runtime data for service already having previous data, the
call to service_data_trigger() will indirectly access the just freed
`s->data` memory through the `s->data_blob` AVL structure.

Fix this issue by moving the call to `service_data_trigger()` before the
freeing of `s->data`.

Signed-off-by: Jo-Philipp Wich <[email protected]>
service/service.c