]> git.karo-electronics.de Git - karo-tx-linux.git/commit
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:39:08 +0000 (08:39 -0600)
commit3e42249d03fd0ca8ce4a92a32ae1ea698b5d5bc7
treeeb4dfe3fbf05e67cd3d7cd8719cd5d827f6ef2d3
parent915ebdfe5a4477835ca960100c451f33cd7d6649
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