sd-bus: make strict asan shut up

System Internals / systemd - Lennart Poettering [] - 16 November 2018 13:32 EST

asan doesn't like it if we use strndup() (i.e. a string function) on a non-NULL terminated buffer (i.e. something that isn't really a string).

Let's hence use memdup_suffix0() instead of strndup(), which is more appropriate for binary data that is to become a string.

Fixes: #10385

ac0a94f74 sd-bus: make strict asan shut up
src/libsystemd/sd-bus/bus-message.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)


  • Share