From fabfef9c82192b04a52cdd092a81d8e10ca20fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 23 Jul 2024 15:29:08 +0200 Subject: [PATCH] notify: consume_stdout(): fix ASAN warning This is an ASAN false positive; size is always 0 when we're passing a NULL pointer. Still, the warning is easy to avoid, so let's do that to reduce the noise level. --- notify.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/notify.c b/notify.c index f8c2bfe1..b16b941b 100644 --- a/notify.c +++ b/notify.c @@ -63,8 +63,10 @@ consume_stdout(struct notification *notif, bool eof) left -= len + (eol != NULL ? 1 : 0); } - memmove(notif->stdout_data, data, left); - notif->stdout_sz = left; + if (left > 0) { + memmove(notif->stdout_data, data, left); + notif->stdout_sz = left; + } } static bool