--- src/crypto/dist/openssl/crypto/asn1/asn1_lib.c.orig	Sun Aug  4 15:24:10 2002
+++ src/crypto/dist/openssl/crypto/asn1/asn1_lib.c	Tue Sep 30 21:05:10 2003
@@ -104,10 +104,12 @@ int ASN1_get_object(unsigned char **pp, 
 			l<<=7L;
 			l|= *(p++)&0x7f;
 			if (--max == 0) goto err;
+			if (l > (INT_MAX >> 7L)) goto err;
 			}
 		l<<=7L;
 		l|= *(p++)&0x7f;
 		tag=(int)l;
+		if (--max == 0) goto err;
 		}
 	else
 		{ 
--- src/crypto/dist/openssl/crypto/x509/x509_vfy.c.orig	Sat Jun 29 11:04:35 2002
+++ src/crypto/dist/openssl/crypto/x509/x509_vfy.c	Tue Sep 30 21:05:11 2003
@@ -490,7 +490,7 @@ static int internal_verify(X509_STORE_CT
 				ok=(*cb)(0,ctx);
 				if (!ok) goto end;
 				}
-			if (X509_verify(xs,pkey) <= 0)
+			else if (X509_verify(xs,pkey) <= 0)
 				{
 				ctx->error=X509_V_ERR_CERT_SIGNATURE_FAILURE;
 				ctx->current_cert=xs;
