Skip to content

Commit

Permalink
module: Fix gratuitous sprintf in module.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rusty Russell committed Jan 29, 2008
1 parent c9a3ba5 commit efa5345
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit efa5345

Please sign in to comment.