Patch to protect against possible buffer overflow.