Fix out of boundary read.
If a binary file which starts with 0x00 is edited, xrdb performs an off-by-one read outside of its buffer.
The fix is simple: Do not try to append an empty string to buffer, which would be a no-op anyway.
Proof of Concept (compile with -fsanitize=address):
$ dd if=/dev/zero bs=1 count=1 of=poc.txt $ xrdb -edit poc.txt
Signed-off-by: Tobias Stoeckmann tobias@stoeckmann.org
Edited by Tobias Stoeckmann