Is there a C function like sprintf in the Linux kernel?

后端 未结 5 1862
甜味超标
甜味超标 2021-01-17 08:24

Is there function like sprintf() in Linux Kernel (like printf()->printk())?

5条回答
  •  情话喂你
    2021-01-17 08:52

    sprintf() is unsafe because of buffer overflow. If you need to pass data from user space to kernel space, use instead copy_from_user(); it acts like copy_to_user() but in reverse direction.

提交回复
热议问题