From 51ba3fa104971ca0ea2afd666289b2a88886b6a3 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 26 Oct 2007 15:15:58 +0200 Subject: [PATCH] afs.c: Avoid strcpy to a fixed size buffer. --- afs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/afs.c b/afs.c index c2ac0e41..34e53806 100644 --- a/afs.c +++ b/afs.c @@ -540,7 +540,9 @@ static int activate_mood_or_playlist(char *arg, int *num_admissible) if (arg) { current_mop = para_strdup(arg); mmd_lock(); - strcpy(mmd->afs_mode_string, arg); /* FIXME: check length */ + strncpy(mmd->afs_mode_string, arg, + sizeof(mmd->afs_mode_string)); + mmd->afs_mode_string[sizeof(mmd->afs_mode_string) - 1] = '\0'; mmd_unlock(); } else { mmd_lock(); -- 2.39.5