zephyr/lib
Carlos Stuart d47178bc95 lib: cmsis_rtos_v2: Default name if name is NULL
Fixed an issue whereby if an attribute structure was passed into a CMSIS
RTOS v2 'new' function with an invalid address i.e. NULL assigned to the
name (char*) member the memcpy at the end of each new function
would cause a segmentation fault i.e. read from an invalid
address.

This has been fixed by checking if the name is NULL and using the
default name from the init struct if it is. This is the same name
that would be used if not passing in the optional attr function
argument.

Changed the memcpy to strncpy to ensure that the copy does not read
beyond the end of the source string and changed the length from 16 to 15
(by means of a `sizeof(...)-1`) of the destination buffer to ensure that
it will always be nul-terminated.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-06 10:20:17 -05:00
..
cmsis_rtos_v1
cmsis_rtos_v2 lib: cmsis_rtos_v2: Default name if name is NULL 2019-02-06 10:20:17 -05:00
gui gui: Upstep LittlevGL to version 5.3 2019-02-04 15:32:29 -05:00
libc
os misc: assert_post_action: Treat POSIX arch like others 2019-02-03 10:28:51 -08:00
posix lib: posix: fix build break due to size comparsion 2019-02-01 23:41:09 -05:00
CMakeLists.txt lib: flatten all loose components into one lib 2019-01-22 07:45:22 -05:00
Kconfig lib: flatten all loose components into one lib 2019-01-22 07:45:22 -05:00