From: Simon Josefsson Date: Fri, 8 Jun 2007 13:22:10 +0000 (+0200) Subject: Fix warnings on amd64, from Nikos. X-Git-Tag: gnutls_1_7_12~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a582d1bb7c1b7007d4b19e6fc3ceeb661a2f89d1;p=thirdparty%2Fgnutls.git Fix warnings on amd64, from Nikos. --- diff --git a/lib/x509/x509.c b/lib/x509/x509.c index 8de03ef51b..fe59ae842c 100644 --- a/lib/x509/x509.c +++ b/lib/x509/x509.c @@ -1010,9 +1010,7 @@ parse_general_name (ASN1_TYPE src, const char *src_name, else if (type == GNUTLS_SAN_DN) { _gnutls_str_cat (nptr, sizeof (nptr), ".directoryName"); - len = *name_size; - result = _gnutls_x509_parse_dn (src, nptr, name, &len); - *name_size = len; + result = _gnutls_x509_parse_dn (src, nptr, name, name_size); if (result < 0) { gnutls_assert (); @@ -1545,7 +1543,11 @@ gnutls_x509_crt_get_extension_info (gnutls_x509_crt_t cert, int indx, snprintf (name, sizeof(name), "tbsCertificate.extensions.?%u.extnID", indx + 1); - result = asn1_read_value (cert->cert, name, oid, sizeof_oid); + + len = *sizeof_oid; + result = asn1_read_value (cert->cert, name, oid, &len); + *sizeof_oid = len; + if (result == ASN1_ELEMENT_NOT_FOUND) return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE; else if (result < 0) @@ -1600,7 +1602,7 @@ int gnutls_x509_crt_get_extension_data (gnutls_x509_crt_t cert, int indx, void *data, size_t * sizeof_data) { - int result; + int result, len; char name[MAX_NAME_SIZE]; if (!cert) @@ -1611,7 +1613,11 @@ gnutls_x509_crt_get_extension_data (gnutls_x509_crt_t cert, int indx, snprintf (name, sizeof(name), "tbsCertificate.extensions.?%u.extnValue", indx + 1); - result = asn1_read_value (cert->cert, name, data, sizeof_data); + + len = *sizeof_data; + result = asn1_read_value (cert->cert, name, data, &len); + *sizeof_data = len; + if (result == ASN1_ELEMENT_NOT_FOUND) return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE; else if (result < 0)