ensure result buffer is initialized (issue #5285)