]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commit
Avoid segfault: Don't read and write into the same buffer. 1111/head
authorSven Panne <svenpanne@gmail.com>
Mon, 22 Mar 2021 11:55:26 +0000 (12:55 +0100)
committerSven Panne <svenpanne@gmail.com>
Mon, 22 Mar 2021 11:55:27 +0000 (12:55 +0100)
commitb8e206429b7e94bf9b3bef158755ac1f0a383dd9
treec2a34de420fc6deee76200271a04710c7b4ba4aa
parent0ede3b3b81a39fb42ccf953ea344d7dc0b26efa9
Avoid segfault: Don't read and write into the same buffer.

Using CTX->rrd_error as a source *and* destination buffer at the same time
provokes undefined behavior.  In real life you get funny error messages
and/or segfaults within vs(n)printf().

Simple solution: Use a temporary copy of the error message while writing
into it.
src/rrd_flushcached.c