Attached patch speaks for itself.
Created attachment 356237 [details] patch to fix buffer overflow
https://sourceforge.net/tracker/?func=detail&aid=2832375&group_id=15273&atid=315273