]> git.baikalelectronics.ru Git - kernel.git/commit
kernel/module.c: use scnprintf() instead of sprintf()
authorChen Gang <gang.chen@asianux.com>
Tue, 20 Aug 2013 06:04:21 +0000 (15:34 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 20 Aug 2013 06:07:46 +0000 (15:37 +0930)
commitdb435afcf3261c5c43cf828d7816617a1cc30310
tree0335af371e340556297fc4ac041f537e8ff2e5de
parent9ba37a1844332c07e710bc6693e2e80e42c28d8d
kernel/module.c: use scnprintf() instead of sprintf()

For some strings, they are permitted to be larger than PAGE_SIZE, so
need use scnprintf() instead of sprintf(), or it will cause issue.

One case is:

  if a module version is crazy defined (length more than PAGE_SIZE),
  'modinfo' command is still OK (print full contents),
  but for "cat /sys/modules/'modname'/version", will cause issue in kernel.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
kernel/module.c