bugfix: unitialized buffer off-by-one error in hostname generation

The DNS cache used uninitialized memory, which could lead to
invalid hostname generation.
Thanks to Jarrod Sayers for alerting us and provinding analysis and
patch recommendations.
Merge branch 'v7-stable' into v8-stable
maintain ChangeLog