summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-01-29 17:13:20 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-01-29 17:13:21 +1100
commitefa5345e39d01deef349c120f55ac6b6eabe7457 (patch)
tree7c8d0919aa380a0db7ac748d6c4571c00aa5c639 /kernel/module.c
parentc9a3ba55bb5da03fc7d707709a7fe078fe1aa0a0 (diff)
downloadlinux-efa5345e39d01deef349c120f55ac6b6eabe7457.tar.gz
linux-efa5345e39d01deef349c120f55ac6b6eabe7457.tar.bz2
linux-efa5345e39d01deef349c120f55ac6b6eabe7457.zip
module: Fix gratuitous sprintf in module.c
Andrew sent an older version of this patch: we shouldn't use sprintf to copy a string. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 17314691d3cc..276abd7b7ff7 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -738,7 +738,7 @@ sys_delete_module(const char __user *name_user, unsigned int flags)
mutex_lock(&module_mutex);
}
/* Store the name of the last unloaded module for diagnostic purposes */
- sprintf(last_unloaded_module, mod->name);
+ strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
free_module(mod);
out: