Add patch for CVE-2014-4378. This patch uses some code written by @feliam.