]> git.ipfire.org Git - thirdparty/pdns.git/commit
misc.cc: Resize hostname to final size in getCarbonHostname()
authorAki Tuomi <cmouse@cmouse.fi>
Sun, 19 Jul 2020 15:06:14 +0000 (18:06 +0300)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 31 Jul 2020 08:09:13 +0000 (10:09 +0200)
commit03a75e14934603c880739e226b7b691ffd0e3902
tree33584da54d0e002345605c73a7a74d003be93110
parent1a7db21d28ee871339783307959d336f9651c74d
misc.cc: Resize hostname to final size in getCarbonHostname()

In 5c21b47fbc35ddcb8d939eb8541c6c3bad1080a8 we change how
hostname is allocated. We allocate getMaxHostNameSize for string,
then give the raw buffer for gethostname function, but forget to
resize the string into actual result length, causing the carbon
output to include trailing NUL bytes after hostname.

(cherry picked from commit 57f8ac68b4fa7063fd2cac4d5b77045e0255c770)
pdns/misc.cc