1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Remove the overflow check in align_buffer().

Reasons stated in https://github.com/mfontanini/libtins/pull/320#discussion_r242049560.
This commit is contained in:
DDoSolitary
2018-12-24 15:20:30 +08:00
parent 18ff3e7b6a
commit b949e56d15

View File

@@ -135,9 +135,6 @@ void align_buffer(const uint8_t* buffer_start, const uint8_t*& buffer, uint32_t
uint32_t offset = (buffer - buffer_start) & (n - 1);
if (offset) {
offset = n - offset;
if (TINS_UNLIKELY(offset > size)) {
throw malformed_packet();
}
buffer += offset;
}
}