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.
This commit is contained in:
Daniel Eklöf 2024-07-23 15:29:08 +02:00
parent e59efb1233
commit fabfef9c82
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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