Commit efa5345e39d01deef349c120f55ac6b6eabe7457
1 parent
c9a3ba55bb
Exists in
master
and in
20 other branches
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>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
kernel/module.c
... | ... | @@ -738,7 +738,7 @@ |
738 | 738 | mutex_lock(&module_mutex); |
739 | 739 | } |
740 | 740 | /* Store the name of the last unloaded module for diagnostic purposes */ |
741 | - sprintf(last_unloaded_module, mod->name); | |
741 | + strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); | |
742 | 742 | free_module(mod); |
743 | 743 | |
744 | 744 | out: |