]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm: fix for the unitialized write buffer
authorJaroslav Kysela <perex@perex.cz>
Thu, 19 May 2022 15:35:08 +0000 (17:35 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 20 May 2022 06:47:07 +0000 (08:47 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
aserver/aserver.c
src/pcm/pcm_shm.c

index 28387021f9966a2ad7e4dabd173df292a575737e..71b8a3cbfeab2af2d7423216e7a36843267c3b42 100644 (file)
@@ -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);
index 26a27a57f3cf32eab4df83a35c816e8b88e20863..1282895843a5366f02b8e43abcb40a6292cbab5b 100644 (file)
@@ -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)