From: Mathieu Desnoyers Date: Mon, 29 Jun 2020 23:52:08 +0000 (-0400) Subject: Fix: callstack context memory corruption X-Git-Tag: v2.13.0-rc1~206 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=c02eb85907f43fe17d97604633ae9aa1ed2afb36;hp=c02eb85907f43fe17d97604633ae9aa1ed2afb36;p=lttng-modules.git Fix: callstack context memory corruption commit ceabb767180e "tracepoint: Refactor representation of nested types" introduces two context fields for callstack contexts. Keeping a pointer to the first field is not valid when adding the second context field to the array, because the array is reallocated. Fix this by introducing new context APIs which operate on indexes rather than pointers: - lttng_append_context_index, - lttng_get_context_field_from_index, - lttng_remove_context_field_index. Add a NULL check to lttng_find_context so it can be used before adding the first context. Signed-off-by: Mathieu Desnoyers ---