File CVE-2011-4128.patch of Package gnutls.import5699

Index: gnutls-2.8.6/lib/gnutls_session.c
===================================================================
--- gnutls-2.8.6.orig/lib/gnutls_session.c
+++ gnutls-2.8.6/lib/gnutls_session.c
@@ -64,13 +64,14 @@ gnutls_session_get_data (gnutls_session_
       gnutls_assert ();
       return ret;
     }
-  *session_data_size = psession.size;
 
   if (psession.size > *session_data_size)
     {
+      *session_data_size = psession.size;
       ret = GNUTLS_E_SHORT_MEMORY_BUFFER;
       goto error;
     }
+  *session_data_size = psession.size;
 
   if (session_data != NULL)
     memcpy (session_data, psession.data, psession.size);