From: Nikos Mavrogiannopoulos Date: Thu, 25 Nov 2004 12:31:35 +0000 (+0000) Subject: corrected bug in parse_dn_oid(). Traced and reported by Pelle Johansson. X-Git-Tag: gnutls_1_1_23~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9a86bb4fa93e0545e276141bb5ab600b3ef606a;p=thirdparty%2Fgnutls.git corrected bug in parse_dn_oid(). Traced and reported by Pelle Johansson. --- diff --git a/lib/x509/dn.c b/lib/x509/dn.c index ca1c574f62..bf3c0f5cf3 100644 --- a/lib/x509/dn.c +++ b/lib/x509/dn.c @@ -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;