Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 488f7d353752a24f1cc3f6fc2e121835 > files > 10

gnutls-1.4.1-10.el5_9.1.src.rpm

diff -up gnutls-1.4.1/lib/gnutls_cipher.c.packet gnutls-1.4.1/lib/gnutls_cipher.c
--- gnutls-1.4.1/lib/gnutls_cipher.c.packet	2012-03-22 15:58:37.110025273 +0100
+++ gnutls-1.4.1/lib/gnutls_cipher.c	2012-03-22 16:13:50.512840958 +0100
@@ -485,14 +485,13 @@ _gnutls_ciphertext2compressed (gnutls_se
 	{
 	  ciphertext.size -= blocksize;
 	  ciphertext.data += blocksize;
-
-	  if (ciphertext.size == 0)
-	    {
-	      gnutls_assert ();
-	      return GNUTLS_E_DECRYPTION_FAILED;
-	    }
 	}
 
+      if (ciphertext.size < hash_size)
+	{
+	  gnutls_assert ();
+	  return GNUTLS_E_DECRYPTION_FAILED;
+	}
       pad = ciphertext.data[ciphertext.size - 1] + 1;	/* pad */
 
       if ((int)pad > (int)ciphertext.size - hash_size)