aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-07-23 13:29:08 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-07-23 13:29:08 +0000
commitfabfef9c82192b04a52cdd092a81d8e10ca20fbf (patch)
treed4f7c0765132c07006eb14af0b3e692c824ea2d6
parentosc: remove unused includes (diff)
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.
-rw-r--r--notify.c6
1 files 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