summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2021-12-20 12:59:20 +0100
committerEugene Syromyatnikov <evgsyr@gmail.com>2021-12-20 12:59:20 +0100
commit1737c2bfc158df335add18c60f8e719ccf78c3cc (patch)
treec6898937e021ad499a40bc652510c777d19acc9b
parentfdf806f2e1c68e32da760e8fedb48c461d720c73 (diff)
downloadstrace-1737c2bfc158df335add18c60f8e719ccf78c3cc.tar.gz
fixup! net: print structure tails if len is too bigesyr/linux-5.16
-rw-r--r--src/net.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/net.c b/src/net.c
index 52bb3add4..12454ece9 100644
--- a/src/net.c
+++ b/src/net.c
@@ -677,11 +677,8 @@ print_get_linger(struct tcb *const tcp, const kernel_ulong_t addr,
linger, l_onoff, len, PRINT_FIELD_D);
MAYBE_PRINT_FIELD_LEN(tprint_struct_next(),
linger, l_linger, len, PRINT_FIELD_D);
- if (len > sizeof(linger)) {
- print_nonzero_bytes(tcp, tprint_struct_next, addr,
- sizeof(linger), MIN(linger, get_pagesize()),
- QUOTE_FORCE_HEX);
- }
+ print_nonzero_bytes(tcp, tprint_struct_next, addr, sizeof(linger),
+ MIN(len, get_pagesize()), QUOTE_FORCE_HEX);
tprint_struct_end();
}
@@ -700,10 +697,8 @@ print_get_ucred(struct tcb *const tcp, const kernel_ulong_t addr,
uc, uid, len, PRINT_FIELD_ID);
MAYBE_PRINT_FIELD_LEN(tprint_struct_next(),
uc, gid, len, PRINT_FIELD_ID);
- if (len > sizeof(uc)) {
- print_nonzero_bytes(tcp, tprint_struct_next, addr, sizeof(uc),
- MIN(uc, get_pagesize()), QUOTE_FORCE_HEX);
- }
+ print_nonzero_bytes(tcp, tprint_struct_next, addr, sizeof(uc),
+ MIN(len, get_pagesize()), QUOTE_FORCE_HEX);
tprint_struct_end();
}
@@ -1153,11 +1148,8 @@ print_tpacket_stats(struct tcb *const tcp, const kernel_ulong_t addr,
stats, tp_drops, len, PRINT_FIELD_U);
MAYBE_PRINT_FIELD_LEN(tprint_struct_next(),
stats, tp_freeze_q_cnt, len, PRINT_FIELD_U);
- if (len > sizeof(stats)) {
- print_nonzero_bytes(tcp, tprint_struct_next, addr,
- sizeof(stats), MIN(stats, get_pagesize()),
- QUOTE_FORCE_HEX);
- }
+ print_nonzero_bytes(tcp, tprint_struct_next, addr, sizeof(stats),
+ MIN(len, get_pagesize()), QUOTE_FORCE_HEX);
tprint_struct_end();
}