]> git.ipfire.org Git - thirdparty/valgrind.git/commit
vgdb.c (fork_and_exec_valgrind): Fix another off-by-one error write
authorMark Wielaard <mark@klomp.org>
Tue, 12 Nov 2024 12:34:09 +0000 (13:34 +0100)
committerMark Wielaard <mark@klomp.org>
Sat, 23 Nov 2024 01:16:45 +0000 (02:16 +0100)
commit8b08da73cf3d72439c4f750c96ed2f088ef1bbec
tree498255ba2c96e2a29ab0c34442e2bae2ca580095
parent2cb0bee2d7722b57956f66a0795b5b9106f88afc
vgdb.c (fork_and_exec_valgrind): Fix another off-by-one error write

commit 646978d9adc5 ("vgdb: Handle EINTR and EAGAIN more
consistently") introduced another off-by-one issue trying to write
back the error from child to parent.

Instead of +1 it should have been +written (which initially is zero).

This is when the child needs to do a chdir and that chdir fails. If
that happens the parent would have gotten the wrong error code.

(cherry picked from commit 747ca4eb5fed5dd58a14391a997bb9e658e3b1c8)
coregrind/vgdb.c