db_updater: Allocate space for trailing NULL byte for long output
When we unescaped strings without newlines, we always wrote a trailing
NULL byte, without actually allocating space for it. This lead to
frequent merlin crashes.
The problem is that unescape_newline is not quite sure if the length
bounds the input or the output - it mostly assumes it bounds both, but
"mostly" is a bad word in C programming.
This fix makes unescape_newline treat its data completely like escaped
binary data - it is now the users job to make sure NULL bytes are where
they're expected. In db_updater, we know that they're in place (as we
dared relying on a strlen), so we can just include this byte among the
bytes we copy.
Change-Id: I6d582103e72b2b3bc937ad1badf8ca52248c5b8b
Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>