diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-05-26 12:35:53 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-05-26 12:35:53 +0200 |
commit | f09f2b9e497d0597f3372014838df08f81f653b4 (patch) | |
tree | fb0ddbe7e5b91aeda8550d172261084d5c828db8 | |
parent | 06cae138000a07dbebcc59728371b86ba6ec30e2 (diff) | |
download | libtasn1-f09f2b9e497d0597f3372014838df08f81f653b4.tar.gz libtasn1-f09f2b9e497d0597f3372014838df08f81f653b4.tar.bz2 libtasn1-f09f2b9e497d0597f3372014838df08f81f653b4.zip |
fixes in length calculation in _asn1_extract_der_octet().
-rw-r--r-- | lib/decoding.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/decoding.c b/lib/decoding.c index 0e28b69..affffed 100644 --- a/lib/decoding.c +++ b/lib/decoding.c @@ -689,7 +689,7 @@ _asn1_extract_der_octet (asn1_node node, const unsigned char *der, if (len2 < -1) return ASN1_DER_ERROR; - if (len2 > 0) + if (len2 >= 0) { DECR_LEN(der_len, len2+len3); _asn1_append_value (node, der + counter + len3, len2); @@ -702,7 +702,7 @@ _asn1_extract_der_octet (asn1_node node, const unsigned char *der, der_len); if (result != ASN1_SUCCESS) return result; - DECR_LEN(der_len, len2); + len2 = 0; } DECR_LEN(der_len, 1); |