]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - vss.c
attribute.c: Always provide the attributes text.
[paraslash.git] / vss.c
diff --git a/vss.c b/vss.c
index 03621e0076a9abc72e14a75c03c6cb2c1c82a00c..4418c53a3080de42b393c9a856a1dd5727e03b74 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -198,7 +198,8 @@ static void vss_eof(void)
        mmd->afd.afhi.chunk_table = NULL;
        tmp  = make_message("%s:\n%s:\n%s:\n", status_item_list[SI_AUDIO_INFO1],
                status_item_list[SI_AUDIO_INFO2], status_item_list[SI_AUDIO_INFO3]);
-       strcpy(mmd->afd.afhi.info_string, tmp);
+       strncpy(mmd->afd.afhi.info_string, tmp, sizeof(mmd->afd.afhi.info_string));
+       mmd->afd.afhi.info_string[sizeof(mmd->afd.afhi.info_string) - 1] = '\0';
        free(tmp);
        mmd->afd.path[0] = '\0';
        mmd->afd.afsi.lyrics_id = 0;
@@ -347,7 +348,6 @@ static int recv_afs_msg(int *fd, uint32_t *code, uint32_t *data)
                return -E_SHORT_AFS_READ;
        *code = *(uint32_t*)buf;
        *data =  *(uint32_t*)(buf + 4);
-       cmsg = CMSG_FIRSTHDR(&msg);
        for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
                if (cmsg->cmsg_level != SOL_SOCKET
                        || cmsg->cmsg_type != SCM_RIGHTS)