Fixed long standing memory buffer overflow issue, listed in bug #690