提交 efa5345e 编写于 作者: R Rusty Russell

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: NRusty Russell <rusty@rustcorp.com.au>
上级 c9a3ba55
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册