Commit 47761827 authored by Andrei Vagin's avatar Andrei Vagin

zdtm/chroot: allocate enough memory for a path

==36==ERROR: AddressSanitizer: heap-buffer-overflow on address
	0x60200000001c at pc 0x7fb26c88d5f9 bp 0x7ffc15087d40 sp 0x7ffc150874d0
WRITE of size 13 at 0x60200000001c thread T0
    #0 0x7fb26c88d5f8 in vsprintf (/lib64/libasan.so.4+0x9e5f8)
    #1 0x7fb26c88d986 in __interceptor_sprintf (/lib64/libasan.so.4+0x9e986)
    #2 0x402453 in main /root/git/main/criu/test/zdtm/static/chroot.c:68
    #3 0x7fb26c43e4d9 in __libc_start_main (/lib64/libc.so.6+0x204d9)
    #4 0x4031b9 in _start (/root/git/main/criu/test/zdtm/static/chroot+0x4031b9)
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent d50f0e90
...@@ -64,7 +64,7 @@ int main(int argc, char **argv) ...@@ -64,7 +64,7 @@ int main(int argc, char **argv)
test_init(argc, argv); test_init(argc, argv);
filepath = malloc(strlen(filename) + 1); filepath = malloc(strlen(filename) + 2);
sprintf(filepath, "/%s", filename); sprintf(filepath, "/%s", filename);
pipe(pipe_prep); pipe(pipe_prep);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment