]> git.baikalelectronics.ru Git - kernel.git/commit
alpha: kernel: using memcpy() instead of strcpy()
authorChen Gang <gang.chen@asianux.com>
Wed, 29 May 2013 10:51:28 +0000 (18:51 +0800)
committerMatt Turner <mattst88@gmail.com>
Fri, 19 Jul 2013 20:54:14 +0000 (13:54 -0700)
commit3b420fe82f59bca1f265d3841cc6804eb5944e99
tree1819f32f291cb321a3123d5c6b8bad44b819f4e9
parentff745b2e66e8bd9688512f95f39eab216619d062
alpha: kernel: using memcpy() instead of strcpy()

When sending message in send_secondary_console_msg(), the length is not
include the NUL byte, and also not copy NUL to 'ipc_buffer'.

When receive message in recv_secondary_console_msg(), the 'cnt' also
excludes NUL.

So when get string from ipc_buffer, it may not be NUL terminated.

Then use memcpy() instead of strcpy(), and set last byte NUL.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Chen Gang <gang.chen@asianux.com>
arch/alpha/kernel/smp.c