From: Simon Josefsson Date: Fri, 9 Feb 2007 06:32:13 +0000 (+0000) Subject: Don't crash on NULL's. X-Git-Tag: gnutls_1_7_6~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14c899493c64ce0e08a682f5c2ac45fec2bef36f;p=thirdparty%2Fgnutls.git Don't crash on NULL's. --- diff --git a/lib/x509/extensions.c b/lib/x509/extensions.c index 97fd7d67bc..afe23ae6cd 100644 --- a/lib/x509/extensions.c +++ b/lib/x509/extensions.c @@ -997,13 +997,16 @@ _gnutls_x509_ext_extract_proxyCertInfo (int *pathLenConstraint, return result; } - *policyLanguage = gnutls_strdup (value.data); + if (policyLanguage) + *policyLanguage = gnutls_strdup (value.data); result = _gnutls_x509_read_value (ext, "proxyPolicy.policy", &value, 0); if (result == GNUTLS_E_ASN1_ELEMENT_NOT_FOUND) { - *policy = NULL; - *sizeof_policy = 0; + if (policy) + *policy = NULL; + if (sizeof_policy) + *sizeof_policy = 0; } else if (result < 0) { @@ -1013,8 +1016,10 @@ _gnutls_x509_ext_extract_proxyCertInfo (int *pathLenConstraint, } else { - *policy = value.data; - *sizeof_policy = value.size; + if (policy) + *policy = value.data; + if (sizeof_policy) + *sizeof_policy = value.size; } asn1_delete_structure (&ext);