kdb: Fix overlap in buffers with strcpy
authorJason Wessel <jason.wessel@windriver.com>
Sun, 3 Feb 2013 15:32:28 +0000 (09:32 -0600)
committerJason Wessel <jason.wessel@windriver.com>
Sat, 2 Mar 2013 14:52:18 +0000 (08:52 -0600)
commit4eb7a66d9410927fb8fbafad8b8298b627cdd128
treec16c9844a02ac61b1d4aac613f18f3157620de46
parent3b0eb71ec9e22c6735c84f800d6523c96839efe6
kdb: Fix overlap in buffers with strcpy

Maxime reported that strcpy(s->usage, s->usage+1) has no definitive
guarantee that it will work on all archs the same way when you have
overlapping memory.  The fix is simple for the kdb code because we
still have the original string memory in the function scope, so we
just have to use that as the argument instead.

Reported-by: Maxime Villard <rustyBSD@gmx.fr>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
kernel/debug/kdb/kdb_main.c