Patch for CVE-2014-7819 vulnerability and add tests from compatible branch