Skip to content

Commit ae94a21

Browse files
Zainullin DamirZainullin Damir
authored andcommitted
++ tls extension reader bugfix
1 parent 59db544 commit ae94a21

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/plugins/process/common/tlsParser/extensionReaders/extensionReader.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ class ExtensionReader : public RangeReader {
4747
return std::nullopt;
4848
}
4949

50-
const auto extensionBegin = payload.data() + sizeof(type) + sizeof(length);
51-
50+
if (sizeof(type) + sizeof(length) + length > payload.size()) {
51+
return std::nullopt;
52+
}
5253
payload = payload.subspan(sizeof(type) + sizeof(length) + length);
5354

55+
const std::byte* extensionBegin = payload.data() + sizeof(type) + sizeof(length);
5456
return TLSExtension {type, {extensionBegin, length}};
5557
});
5658
}

0 commit comments

Comments
 (0)