diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-05-17 09:11:10 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-05-17 09:16:07 +0200 |
commit | e47b2a0651ffe1867c844968ade7f6127957bf13 (patch) | |
tree | 9db3c89f8cefaac87be72943c15f52d16f908be6 /lib/decoding.c | |
parent | e3a8295c5784d36e1a2b1fb0823fda164366e067 (diff) | |
download | libtasn1-e47b2a0651ffe1867c844968ade7f6127957bf13.tar.gz libtasn1-e47b2a0651ffe1867c844968ade7f6127957bf13.tar.bz2 libtasn1-e47b2a0651ffe1867c844968ade7f6127957bf13.zip |
Reverted ltostr() changes as the cause a significant delay to the library.
The best approach would be to eliminate the need for ltostr() completely.
Added LTOSTR_MAX_SIZE, to avoid overflows.
Diffstat (limited to 'lib/decoding.c')
-rw-r--r-- | lib/decoding.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/decoding.c b/lib/decoding.c index f85451f..93bc962 100644 --- a/lib/decoding.c +++ b/lib/decoding.c @@ -302,7 +302,7 @@ _asn1_get_objectid_der (const unsigned char *der, int der_len, int *ret_len, { int len_len, len, k; int leading; - char temp[20]; + char temp[LTOSTR_MAX_SIZE]; unsigned long val, val1; *ret_len = 0; @@ -1952,7 +1952,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName, counter += len2; if (len3 > 0) { - _asn1_ltostr (counter + len3, temp, sizeof(temp)); + _asn1_ltostr (counter + len3, temp); tlen = strlen (temp); if (tlen > 0) @@ -2035,7 +2035,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName, counter += len2; if (len3) { - _asn1_ltostr (counter + len3, temp, sizeof(temp)); + _asn1_ltostr (counter + len3, temp); tlen = strlen (temp); if (tlen > 0) |