From: Andre Noll Date: Fri, 26 Oct 2007 13:15:58 +0000 (+0200) Subject: afs.c: Avoid strcpy to a fixed size buffer. X-Git-Tag: v0.3.0~188 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=51ba3fa104971ca0ea2afd666289b2a88886b6a3 afs.c: Avoid strcpy to a fixed size buffer. --- 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();