From: Jaroslav Kysela Date: Thu, 19 May 2022 15:35:08 +0000 (+0200) Subject: pcm: fix for the unitialized write buffer X-Git-Tag: v1.2.7~19 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=a53c2b25f1c7950c8a46f790dc19f7b57779ad78;p=alsa-lib.git pcm: fix for the unitialized write buffer Signed-off-by: Jaroslav Kysela --- diff --git a/aserver/aserver.c b/aserver/aserver.c index 28387021..71b8a3cb 100644 --- a/aserver/aserver.c +++ b/aserver/aserver.c @@ -530,7 +530,7 @@ transport_ops_t pcm_shm_ops = { static int ctl_handler(waiter_t *waiter, unsigned short events) { client_t *client = waiter->private_data; - char buf[1]; + char buf[1] = ""; ssize_t n; if (events & POLLIN) { n = write(client->poll_fd, buf, 1); diff --git a/src/pcm/pcm_shm.c b/src/pcm/pcm_shm.c index 26a27a57..12828958 100644 --- a/src/pcm/pcm_shm.c +++ b/src/pcm/pcm_shm.c @@ -61,7 +61,7 @@ static long snd_pcm_shm_action_fd0(snd_pcm_t *pcm, int *fd) { snd_pcm_shm_t *shm = pcm->private_data; int err; - char buf[1]; + char buf[1] = ""; volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl; err = write(shm->socket, buf, 1); @@ -113,7 +113,7 @@ static long snd_pcm_shm_action(snd_pcm_t *pcm) { snd_pcm_shm_t *shm = pcm->private_data; int err, result; - char buf[1]; + char buf[1] = ""; volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl; if (ctrl->hw.changed || ctrl->appl.changed) @@ -148,7 +148,7 @@ static long snd_pcm_shm_action_fd(snd_pcm_t *pcm, int *fd) { snd_pcm_shm_t *shm = pcm->private_data; int err; - char buf[1]; + char buf[1] = ""; volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl; if (ctrl->hw.changed || ctrl->appl.changed)