trace-cmd: Make msgcpy() and optcpy() check for size

Have msgcpy() and optcpy() test the offset + buflen to see if it would
overwrite the size of the msg or opt. If so, return -ENIVAL. The checking of
this return value still needs to be done, but at least we wont be
accidentally overwriting the memory.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 file changed