Merge branch 'tintou/no-use-after-free' into 'master'

libsysprof: Avoid a use-after-free in raxRemove

See merge request GNOME/sysprof!63
This commit is contained in:
Christian Hergert
2023-01-18 21:02:12 +00:00

View File

@ -1052,6 +1052,7 @@ int raxRemove(rax *rax, unsigned char *s, size_t len, void **old) {
debugf("Freeing child %p [%.*s] key:%d\n", (void*)child, debugf("Freeing child %p [%.*s] key:%d\n", (void*)child,
(int)child->size, (char*)child->data, child->iskey); (int)child->size, (char*)child->data, child->iskey);
rax_free(child); rax_free(child);
child = NULL;
rax->numnodes--; rax->numnodes--;
h = raxStackPop(&ts); h = raxStackPop(&ts);
/* If this node has more then one child, or actually holds /* If this node has more then one child, or actually holds