BACKPORT: Apply fix for CVE-2012-2131

Fix is from http://cvs.openssl.org/chngview?cn=22479

The previous fix for CVE-2012-221 did not handle the 'len' argument to
BUF_MEM_grow and BUF_MEM_grow_clean being negative. This patch fixes that
by rejecting a negative len parameter.

BUG=chromium-os:30134
TEST=patched; emerge-amd64-generic openssl;
     chroot /build/amd64-generic/ /usr/bin/curl -Iv https://encrypted.google.com;
     chroot /build/amd64-generic/ /usr/bin/openssl s_client -connect encrypted.google.com:443 -debug;
     Outside the chroot:
        make all && make tests

Change-Id: I4a45d21c4fdf611d52be7c12e5f623e9771394f1
1 file changed