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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user