Fix for a potential buffer overflow issue raised by veracode static scan.