Skip to content

Commit

Permalink
tls: add tcp segment check
Browse files Browse the repository at this point in the history
  • Loading branch information
azzbcc authored and Kaian committed Sep 22, 2021
1 parent 3f7659e commit a863151
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/packet/packet_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,9 @@ packet_tls_process_record(SSLConnection *conn, GBytes *data, GBytes **out)

// Process record fragment
if (UINT16_INT(record.length) > 0) {
if (UINT16_INT(record.length) > (int) g_bytes_get_size(data)) {
return g_bytes_offset(data, g_bytes_get_size(data));
}
// TLSPlaintext fragment pointer
g_autoptr(GBytes) fragment = g_bytes_new(g_bytes_get_data(data, NULL), g_bytes_get_size(data));
data = g_bytes_offset(data, UINT16_INT(record.length));
Expand Down

0 comments on commit a863151

Please sign in to comment.