summaryrefslogtreecommitdiff
path: root/lib/decoding.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2014-05-17 08:10:32 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-05-17 08:10:32 +0200
commit02d59b37540609c0be510642a8eb0f72799ca6c6 (patch)
tree364c2507d2d2c91062553ead6994ab1208c84daf /lib/decoding.c
parent03fd1d469a5f9ee27ab7466c2b33a92e7b991260 (diff)
downloadlibtasn1-02d59b37540609c0be510642a8eb0f72799ca6c6.tar.gz
libtasn1-02d59b37540609c0be510642a8eb0f72799ca6c6.tar.bz2
libtasn1-02d59b37540609c0be510642a8eb0f72799ca6c6.zip
Use the new functions in asn1_decoding_element()
Diffstat (limited to 'lib/decoding.c')
-rw-r--r--lib/decoding.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/decoding.c b/lib/decoding.c
index 0d48505..949467a 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -1846,15 +1846,14 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
move = RIGHT;
break;
case ASN1_ETYPE_OCTET_STRING:
- len3 = len - counter;
if (state == FOUND)
{
- result = _asn1_get_octet_string (der + counter, p, &len3);
+ result = _asn1_get_octet_string (p, der + counter, len-counter, &len3);
if (p == nodeFound)
state = EXIT;
}
else
- result = _asn1_get_octet_string (der + counter, NULL, &len3);
+ result = _asn1_get_octet_string (NULL, der + counter, len-counter, &len3);
if (result != ASN1_SUCCESS)
goto cleanup;
@@ -1950,7 +1949,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
counter += len2;
if (len3 > 0)
{
- _asn1_ltostr (counter + len3, temp);
+ _asn1_ltostr (counter + len3, temp, sizeof(temp));
tlen = strlen (temp);
if (tlen > 0)
@@ -2033,7 +2032,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
counter += len2;
if (len3)
{
- _asn1_ltostr (counter + len3, temp);
+ _asn1_ltostr (counter + len3, temp, sizeof(temp));
tlen = strlen (temp);
if (tlen > 0)
@@ -2096,9 +2095,8 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
else
indefinite = 0;
- len2 = len - counter;
result =
- _asn1_get_indefinite_length_string (der + counter, &len2);
+ _asn1_get_indefinite_length_string (der + counter, len-counter, &len2);
if (result != ASN1_SUCCESS)
goto cleanup;