]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
corrected bug in parse_dn_oid(). Traced and reported by Pelle Johansson.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 25 Nov 2004 12:31:35 +0000 (12:31 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 25 Nov 2004 12:31:35 +0000 (12:31 +0000)
lib/x509/dn.c

index ca1c574f628ce1a5173a37422fb7a79d97d3576e..bf3c0f5cf389c6f99d44758dc97397979d69aead 100644 (file)
@@ -422,6 +422,8 @@ int _gnutls_x509_parse_dn_oid(ASN1_TYPE asn1_struct,
 
                if (result != ASN1_SUCCESS) {
                    gnutls_assert();
+                   if (result==ASN1_MEM_ERROR)
+                       *sizeof_buf = len;
                    result = _gnutls_asn2err(result);
                    goto cleanup;
                }
@@ -429,7 +431,8 @@ int _gnutls_x509_parse_dn_oid(ASN1_TYPE asn1_struct,
                if (raw_flag != 0) {
                    if ((uint) len > *sizeof_buf) {
                        *sizeof_buf = len;
-                       return GNUTLS_E_SHORT_MEMORY_BUFFER;
+                       result = GNUTLS_E_SHORT_MEMORY_BUFFER;
+                       goto cleanup;
                    }
                    *sizeof_buf = len;