Skip to content

Commit cee2b96

Browse files
mstemmmattpag
authored andcommitted
Fix off-by-one error with loginuid extract
The number of params for the execve event is 19 with the loginuid being the last param, so the check should be > 18. Extracting param 18 (which is 0-based indexing into the array of params) is still correct.
1 parent 80f2142 commit cee2b96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

userspace/libsinsp/parsers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,13 +1746,13 @@ void sinsp_parser::parse_execve_exit(sinsp_evt *evt)
17461746
// to identify the version of the event.
17471747
// For example:
17481748
//
1749-
// if(evt->get_num_params() > 17)
1749+
// if(evt->get_num_params() > 18)
17501750
// {
17511751
// ...
17521752
// }
17531753

17541754
// Get the loginuid
1755-
if(evt->get_num_params() > 17)
1755+
if(evt->get_num_params() > 18)
17561756
{
17571757
parinfo = evt->get_param(18);
17581758
ASSERT(parinfo->m_len == sizeof(uint32_t));

0 commit comments

Comments
 (0)