File CVE-2012-2333.patch of Package compat-openssl098.703

Index: openssl-0.9.8j/ssl/d1_enc.c
===================================================================
--- openssl-0.9.8j.orig/ssl/d1_enc.c
+++ openssl-0.9.8j/ssl/d1_enc.c
@@ -258,6 +258,7 @@ int dtls1_enc(SSL *s, int send)
 			/* TLS 1.0 does not bound the number of padding bytes by the block size.
 			 * All of them must have value 'padding_length'. */
 			if (i > (int)rec->length)
+			if (i + bs > (int)rec->length)
 				{
 				/* Incorrect padding. SSLerr() and ssl3_alert are done
 				 * by caller: we don't want to reveal whether this is