Skip to content
Commit 542ea03c authored by Tim Pambor's avatar Tim Pambor Committed by Daniel DeGrasse
Browse files

include: cbprintf: Fix call to memcpy with null pointer



cbprintf_package_convert may invoke z_cbprintf_cpy with a null pointer
to buf and zero length to indicate a flush operation. This triggers
an error from the undefined behavior sanitizer due to memcpy being called
with a null src, which is undefined behavior according to the C standard.

This is avoided by exiting early in z_cbprintf_cpy when length is zero.

Signed-off-by: default avatarTim Pambor <tim.pambor@codewrights.de>
parent 44aaa844
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment