From 7a6766cb525e3af0fe9f4d05446d15110599ed7c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 19 Feb 2019 08:23:20 +0100 Subject: fixup x509asn1: make encodeOID() return 0 on error --- lib/x509asn1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/x509asn1.c b/lib/x509asn1.c index 6977b156b..25231921c 100644 --- a/lib/x509asn1.c +++ b/lib/x509asn1.c @@ -383,7 +383,7 @@ static size_t encodeUint(char *buf, size_t buflen, unsigned int x) /* * Convert an ASN.1 OID into its dotted string representation. * Store the result in th `n'-byte buffer at `buf'. - * Return the converted string length, or -1 if an error occurs. + * Return the converted string length, or 0 on errors. */ static size_t encodeOID(char *buf, size_t buflen, const char *beg, const char *end) @@ -413,7 +413,7 @@ static size_t encodeOID(char *buf, size_t buflen, x = 0; do { if(x & 0xFF000000) - return -1; + return 0; y = *(const unsigned char *) beg++; x = (x << 7) | (y & 0x7F); } while(y & 0x80); -- cgit v1.2.1