mbed-os/platform
Tero Jääskö 6effd3d3ad tr_array: fix use after free error after mbed_trace_free() is called
If one called mbed_trace_free() but continued using the trace (which
is a supported use case), the already freed tmp_data buffer was used
by tr_array().

This was spotted by Valgrind on some unit tests which do enable the
trace only temporarily for some of the tests.

Error being fixed in this PR:
--8<--8<--8<---
==5865== Invalid write of size 1
==5865==    at 0x2639BB: mbed_trace_array (mbed_trace.c:569)
<...>
==5865==  Address 0x5dc79d0 is 0 bytes inside a block of size 128 free'd
==5865==    at 0x4C32D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5865==    by 0x262723: mbed_trace_free (mbed_trace.c:192)
<...>
==5865==  Block was alloc'd at
==5865==    at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5865==    by 0x262548: mbed_trace_init (mbed_trace.c:162)
<...>
2021-06-28 09:38:10 +03:00
..
FEATURE_EXPERIMENTAL_API psa: Remove outdated macro checks in tests 2021-05-19 11:00:26 +01:00
bare_metal Added missing blockdevice mbed_lib.json 2020-11-02 16:35:26 +00:00
cxxsupport Namespace scope mbed:: added for CriticalSectionLock used in Atomic templates 2021-06-08 22:55:43 +02:00
docs fix(docs): corrects various typos in project documentation 2021-04-23 23:31:11 -05:00
include/platform Update Mbed version block 2021-06-18 11:54:51 +01:00
mbed-trace tr_array: fix use after free error after mbed_trace_free() is called 2021-06-28 09:38:10 +03:00
randlib CMake: Rename CMake targets 2020-11-06 17:25:22 +00:00
source Fcntl setting Non Blocking operations improvement 2021-06-09 15:36:24 +02:00
tests CMake: unit-tests: Remove trailing whitespace 2021-06-10 23:24:43 +01:00
CMakeLists.txt CMake: Only build unit tests if Mbed OS is the current project 2021-06-10 23:34:14 +01:00
mbed_lib.json M2354: Support TF-M 2021-05-26 09:35:02 +08:00