HPCC-10557  Fix potential buffer overrun

Signed-off-by: Gleb Aronsky <gleb.aronsky@lexisnexis.com>