lib: os: cbprintf: Add assert to Z_CBPRINTF_ON_STACK_ALLOC
Add protection if number of string arguments exceed the limit which currently is set to 32. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
786647bdcf
commit
80c59df211
1 changed files with 1 additions and 0 deletions
|
|
@ -359,6 +359,7 @@ union z_cbprintf_hdr {
|
|||
* multiple times. VLA is not always available.
|
||||
*/
|
||||
#define Z_CBPRINTF_ON_STACK_ALLOC(_name, _len) \
|
||||
__ASSERT(_len <= 32, "Too many string arguments."); \
|
||||
uint8_t _name##_buf4[4]; \
|
||||
uint8_t _name##_buf8[8]; \
|
||||
uint8_t _name##_buf12[12]; \
|
||||
|
|
|
|||
Loading…
Reference in a new issue