From f6316d1b68c85af2eecfef5ee0a62fff8a8d8954 Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Thu, 19 May 2022 10:10:32 +0200 Subject: [PATCH] Fix memcheck/tests/freebsd/fexecve This contained a stupid mistake, and had been working by luck. --- memcheck/tests/freebsd/fexecve.c | 4 ++-- memcheck/tests/freebsd/fexecve.stderr.exp | 25 +++++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/memcheck/tests/freebsd/fexecve.c b/memcheck/tests/freebsd/fexecve.c index 6fe62ed597..222ff94ce9 100644 --- a/memcheck/tests/freebsd/fexecve.c +++ b/memcheck/tests/freebsd/fexecve.c @@ -21,8 +21,8 @@ int main(int argc, char **argv, char** envp) int * new_fd = malloc(sizeof(int)); *new_fd += fd; new_argv[1] = new_envp[1] = NULL; - argv[0] = arg1; - envp[0] = env1; + new_argv[0] = arg1; + new_envp[0] = env1; free(arg1); free(env1); diff --git a/memcheck/tests/freebsd/fexecve.stderr.exp b/memcheck/tests/freebsd/fexecve.stderr.exp index 5bb85f79dc..a541658168 100644 --- a/memcheck/tests/freebsd/fexecve.stderr.exp +++ b/memcheck/tests/freebsd/fexecve.stderr.exp @@ -2,22 +2,25 @@ Syscall param fexecve(fd) contains uninitialised byte(s) at 0x........: fexecve (in /...libc...) by 0x........: main (fexecve.c:29) -Syscall param fexecve(argv) points to uninitialised byte(s) - at 0x........: fexecve (in /...libc...) - by 0x........: main (fexecve.c:29) - Address 0x........ is 0 bytes inside a block of size ... alloc'd - at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (fexecve.c:17) - Syscall param fexecve(argv[0]) points to unaddressable byte(s) at 0x........: fexecve (in /...libc...) by 0x........: main (fexecve.c:29) - Address 0x........ is not stack'd, malloc'd or (recently) free'd + Address 0x........ is 0 bytes inside a block of size 10 free'd + at 0x........: free (vg_replace_malloc.c:...) + by 0x........: main (fexecve.c:27) + Block was alloc'd at + at 0x........: malloc (vg_replace_malloc.c:...) + ... + by 0x........: main (fexecve.c:19) -Syscall param fexecve(envp) points to uninitialised byte(s) +Syscall param fexecve(envp[i]) points to unaddressable byte(s) at 0x........: fexecve (in /...libc...) by 0x........: main (fexecve.c:29) - Address 0x........ is 0 bytes inside a block of size ... alloc'd + Address 0x........ is 0 bytes inside a block of size 8 free'd + at 0x........: free (vg_replace_malloc.c:...) + by 0x........: main (fexecve.c:28) + Block was alloc'd at at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (fexecve.c:18) + ... + by 0x........: main (fexecve.c:20) -- 2.47.2