From 10b4528b4d2de2a1df41f34c5f6bfc88f4520d15 Mon Sep 17 00:00:00 2001 From: Aidan Cyr Date: Fri, 9 Aug 2024 07:13:00 +1000 Subject: [PATCH] Fix some invalid decoded lengths from various --- src/BERDecode.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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