diff --git a/src/BERDecode.cpp b/src/BERDecode.cpp index 9ecfe28..229a535 100644 --- a/src/BERDecode.cpp +++ b/src/BERDecode.cpp @@ -133,7 +133,7 @@ int OIDType::fromBuffer(const uint8_t *buf, size_t max_len){ this->data.assign(dataPtr, dataPtr + _length); this->valid = true; - return _length + 2; + return _length + j; } static inline void long_to_buf(char* buf, long l, short r = 0){ @@ -208,7 +208,7 @@ int Counter64::fromBuffer(const uint8_t *buf, size_t max_len){ _value = _value | *ptr++; tempLength--; } - return _length + 2; + return _length + i; } std::shared_ptr ComplexType::createObjectForType(ASN_TYPE valueType){ @@ -290,5 +290,5 @@ int ComplexType::fromBuffer(const uint8_t *buf, size_t max_len){ ptr += used_length; i += used_length; } - return _length + 2; + return _length + j; } \ No newline at end of file