The callback example seems to truncate the command line, but seems not affected by the garbage ending bytes.
Example of random bytes found in the exeArgs string from sysflow callback when integrating libsysflow (observe the end):
Additional context
The problem causes sporadic program crashes when the string is decoded since sometimes the garbage bytes are not valid UTF-8 codes.
Jun 10 16:15:53 ubuntu2204.localdomain test[12486]: terminate called after throwing an instance of 'nlohmann::json_abi_v3_11_2::detail::type_error'
Jun 10 16:15:53 ubuntu2204.localdomain test[12486]: what(): [json.exception.type_error.316] invalid UTF-8 byte at index 2300: 0x30
Indicate project libsysflow
Describe the bug Long command line is truncated and sometimes filled with garbage bytes at the end.
To reproduce Steps to reproduce the behavior:
The callback example seems to truncate the command line, but seems not affected by the garbage ending bytes. Example of random bytes found in the
exeArgs
string from sysflow callback when integrating libsysflow (observe the end):Expected behavior The command line is reported correctly, even truncated but without garbage bytes at the end.
Environment (please complete the following information):
Linux ubuntu2204.localdomain 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
/root/.falco/6.0.1+driver/x86_64/falco_ubuntu-generic_5.15.0-69-generic_76.o
)Additional context The problem causes sporadic program crashes when the string is decoded since sometimes the garbage bytes are not valid UTF-8 codes.