zephyr/lib
Andy Ross 0d4954fafc lib/cmsis_rtos_v2: Fix overflow in osKernelGetInfo()
If any of the Zephyr version numbers went beyond 99, the "%2d" printf
specifiers would expand to fit and the string would run over the
memory on the stack used for os_str[].

Recent GCC versions (remember native_posix and x86_64 use the host
compiler) were actually detecting this and correctly issuing a warning
(but only if the 3-digit char value would overflow the actual array
size!), which was breaking sanitycheck for me on Fedora 28 and Ubuntu
18.04 build hosts.  Pretty impresive warning.

As it happens this was wasteful anyway; we were spending bytes on the
stack (and in rodata to store the constant which, and the cycles
needed to copy it into place on the stack where it would be
overwritten immediately) when we could just snprintf() directly into
the buffer the user gave us.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-12-26 09:41:41 -05:00
..
base64 lib: Add 'U' to unsigned variable assignments 2018-12-04 22:51:56 -05:00
cmsis_rtos_v1 lib: Add 'U' to unsigned variable assignments 2018-12-04 22:51:56 -05:00
cmsis_rtos_v2 lib/cmsis_rtos_v2: Fix overflow in osKernelGetInfo() 2018-12-26 09:41:41 -05:00
crc crc: deprecate old headers and issue warning when used 2018-12-04 08:52:46 -06:00
json
libc lib/fdtable: Add ioctl() and fcntl() implementations 2018-12-14 13:21:31 +02:00
mempool lib/mempool: One more spurious -ENOMEM condition 2018-11-20 11:35:10 +01:00
posix lib: posix: Explicitly ignoring return of memcpy 2018-12-19 14:37:25 +01:00
rbtree lib: rbtree: Do not use lowercase l for literal suffix 2018-12-07 09:06:34 -05:00
ring_buffer lib: Add 'U' to unsigned variable assignments 2018-12-04 22:51:56 -05:00
CMakeLists.txt lib/cmsis_rtos_v2: Implement support for thread APIs 2018-12-20 12:23:22 +01:00
Kconfig lib/cmsis_rtos_v2: Implement support for thread APIs 2018-12-20 12:23:22 +01:00
fdtable.c lib/fdtable: Add ioctl() and fcntl() implementations 2018-12-14 13:21:31 +02:00
thread_entry.c
work_q.c kernel: add user mode work_q capability 2018-11-29 09:21:18 -08:00