1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

x509asn1: minor edit to unconfuse Coverity

CID 1202732 warns on the previous use, although I cannot fine any
problems with it. I'm doing this change only to make the code use a more
familiar approach to accomplish the same thing.
This commit is contained in:
Daniel Stenberg 2015-03-21 16:21:01 +01:00
parent 57dc2f7e40
commit e6917d3b77

View File

@ -536,8 +536,6 @@ static const char * UTime2str(const char * beg, const char * end)
const char * Curl_ASN1tostr(curl_asn1Element * elem, int type) const char * Curl_ASN1tostr(curl_asn1Element * elem, int type)
{ {
static const char zero = '\0';
/* Convert an ASN.1 element to a printable string. /* Convert an ASN.1 element to a printable string.
Return the dynamically allocated string, or NULL if an error occurs. */ Return the dynamically allocated string, or NULL if an error occurs. */
@ -558,7 +556,7 @@ const char * Curl_ASN1tostr(curl_asn1Element * elem, int type)
case CURL_ASN1_OCTET_STRING: case CURL_ASN1_OCTET_STRING:
return octet2str(elem->beg, elem->end); return octet2str(elem->beg, elem->end);
case CURL_ASN1_NULL: case CURL_ASN1_NULL:
return strdup(&zero); return strdup("");
case CURL_ASN1_OBJECT_IDENTIFIER: case CURL_ASN1_OBJECT_IDENTIFIER:
return OID2str(elem->beg, elem->end, TRUE); return OID2str(elem->beg, elem->end, TRUE);
case CURL_ASN1_UTC_TIME: case CURL_ASN1_UTC_TIME: