All of lore.kernel.org
 help / color / mirror / Atom feed
* [tglx-devel:x86/topology 22/41] arch/x86/kernel/cpu/debugfs.c:53:35: warning: 'sprintf' may write a terminating nul past the end of the destination
@ 2023-09-19 16:02 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-09-19 16:02 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/topology
head:   68e2a6fab985dc1ed5e9e7e2b0a8998ef2951772
commit: b8f285eb46639df7f680c92122aa65302f32e2cd [22/41] x86/cpu: Provide debug interface
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230919/202309192324.p3ySFahn-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230919/202309192324.p3ySFahn-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309192324.p3ySFahn-lkp@intel.com/

All warnings (new ones prefixed by >>):

   arch/x86/kernel/cpu/debugfs.c: In function 'cpu_init_debugfs':
>> arch/x86/kernel/cpu/debugfs.c:53:35: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
      53 |                 sprintf(name, "%lu", id);
         |                                   ^
   arch/x86/kernel/cpu/debugfs.c:53:17: note: 'sprintf' output between 2 and 11 bytes into a destination of size 10
      53 |                 sprintf(name, "%lu", id);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~


vim +/sprintf +53 arch/x86/kernel/cpu/debugfs.c

    44	
    45	static __init int cpu_init_debugfs(void)
    46	{
    47		struct dentry *dir, *base = debugfs_create_dir("topo", arch_debugfs_dir);
    48		unsigned long id;
    49		char name[10];
    50	
    51		dir = debugfs_create_dir("cpus", base);
    52		for_each_possible_cpu(id) {
  > 53			sprintf(name, "%lu", id);

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-19 16:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-19 16:02 [tglx-devel:x86/topology 22/41] arch/x86/kernel/cpu/debugfs.c:53:35: warning: 'sprintf' may write a terminating nul past the end of the destination kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.