out of bounds access in DLE encoder #492

Merged
mohr merged 8 commits from mueller/dle-possible-bugfix into development 2021-10-04 14:43:54 +02:00
Showing only changes of commit 2439613f21 - Show all commits

View File

@ -198,7 +198,7 @@ ReturnValue_t DleEncoder::decodeStreamEscaped(const uint8_t *sourceStream, size_
break;
}
case(STX_CHAR): {
*readLen = ++encodedIndex;
*readLen = encodedIndex;
mohr marked this conversation as resolved Outdated
Outdated
Review

I think this should be *readLen = encodedIndex;, we should preserve the STX as it might start a new, valid frame.

I think this should be `*readLen = encodedIndex;`, we should preserve the `STX` as it might start a new, valid frame.
return DECODING_ERROR;
}
case(ETX_CHAR): {