Skip to content

Commit 84c5ad8

Browse files
ChrisYx511therealbobo
authored andcommitted
fix(userspace/sysdig): prevent integer underflow when an event with a timestamp prior to duration_start is logged while using '-M' CLI flag
Signed-off-by: Chris Yang <chris.yang@shopify.com>
1 parent 7f09646 commit 84c5ad8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

userspace/sysdig/sysdig.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,8 @@ captureinfo do_inspect(sinsp *inspector, sinsp_cycledumper *dumper,
817817
duration_start = ev->get_ts();
818818
} else if(duration_to_tot_ns > 0)
819819
{
820-
if(ev->get_ts() - duration_start >= duration_to_tot_ns)
820+
if(ev->get_ts() > duration_start &&
821+
ev->get_ts() - duration_start >= duration_to_tot_ns)
821822
{
822823
handle_end_of_file(inspector, print_progress, reset_colors, formatter);
823824
break;

0 commit comments

Comments
 (0)