projects
/
paraslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
39113a4
)
afs.c: Avoid strcpy to a fixed size buffer.
author
Andre Noll
<maan@systemlinux.org>
Fri, 26 Oct 2007 13:15:58 +0000
(15:15 +0200)
committer
Andre Noll
<maan@systemlinux.org>
Fri, 26 Oct 2007 13:15:58 +0000
(15:15 +0200)
afs.c
patch
|
blob
|
history
diff --git
a/afs.c
b/afs.c
index c2ac0e4110e15ceac8f677947894e2a1afd057b4..34e53806e1470be55bf94c82098a63dbfd953fa3 100644
(file)
--- 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();
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();
mmd_unlock();
} else {
mmd_lock();