Fix for CVE-2012-0722, patch provided by Sajjad Pourali http://www.securation.com/