quick backport of CVE-2014-0130 fix