]> sourceware.org Git - systemtap.git/commit
PR26844: fix off-by-one error when copying printed backtraces
authorSultan Alsawaf <sultan@openresty.com>
Wed, 9 Dec 2020 20:55:10 +0000 (12:55 -0800)
committerSultan Alsawaf <sultan@openresty.com>
Wed, 9 Dec 2020 20:55:10 +0000 (12:55 -0800)
commitfd93cf71df80f7bb5aae707ea5a5875727a85770
treeaffda5c7982590ac70de179058e3e72ecfe2776f
parentcd6399e621646856824ea96b11605a0f52011272
PR26844: fix off-by-one error when copying printed backtraces

Since log->buf isn't null-terminated, log->len represents the total
number of bytes present in the log buffer for copying. The use of
strlcpy() here with log->len as its size results in log->len - 1 bytes
being copied, with the log->len'nth byte of the output buffer being set
to zero to terminate the string. Use memcpy() instead to remedy this,
while ensuring that the output buffer has space for null termination,
since the output buffer needs to be terminated.
runtime/stack.c
This page took 0.033058 seconds and 5 git commands to generate.