backport CVE-2013-6420 from PHP 5.3 branch
backport CVE-2013-4073 from php 5.3 branch