Message ID | 20210628224042.0ecc2030@oasis.local.home (mailing list archive) |
---|---|
State | Accepted |
Commit | 30f5b9202e8d164c33902fc6aedf8b736272ceb6 |
Headers | show |
Series | trace-cmd split: Assert if the calculated record size is too big | expand |
diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c index 9b1a8d7a..775611c1 100644 --- a/tracecmd/trace-split.c +++ b/tracecmd/trace-split.c @@ -118,6 +118,9 @@ static int write_record(struct tracecmd_input *handle, if (!len) { len = record->size + 4; + if ((len + 4) > record->record_size) + die("Bad calculation of record len (expect:%d actual:%d)", + record->record_size, len + 4); *(unsigned *)ptr = tep_read_number(pevent, &len, 4); ptr += 4; index += 4;