summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-02-19 08:23:20 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-02-19 08:23:58 +0100
commit7a6766cb525e3af0fe9f4d05446d15110599ed7c (patch)
treeb103816f835621693f916dcc9626611fd7b0673d
parentd9ee32301cb395cf5db1bec3b904ee31140ad1bc (diff)
downloadcurl-bagder/x509-cleanup.tar.gz
fixup x509asn1: make encodeOID() return 0 on errorbagder/x509-cleanup
-rw-r--r--lib/x509asn1.c4
1 files 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);