Skip to content

Commit

Permalink
fix(userspace/libsinsp): always initialize sinsp_evt with a proper so…
Browse files Browse the repository at this point in the history
…urce_idx and source_name.

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP authored and poiana committed Dec 9, 2024
1 parent 0b53bd7 commit 4462fee
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions userspace/libsinsp/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,13 @@ sinsp_evt::sinsp_evt():
m_errorcode(0),
m_rawbuf_str_len(0),
m_filtered_out(false),
m_event_info_table(g_infotables.m_event_info) {}
m_event_info_table(g_infotables.m_event_info),
m_source_idx(sinsp_no_event_source_idx),
m_source_name(NULL) {}

sinsp_evt::sinsp_evt(sinsp *inspector):
m_inspector(inspector),
m_pevt(NULL),
m_pevt_storage(NULL),
m_cpuid(0),
m_evtnum(0),
m_flags(EF_NONE),
m_params_loaded(false),
m_info(NULL),
m_paramstr_storage(1024),
m_resolved_paramstr_storage(1024),
m_tinfo(NULL),
m_fdinfo(NULL),
m_fdinfo_name_changed(false),
m_iosize(0),
m_errorcode(0),
m_rawbuf_str_len(0),
m_filtered_out(false),
m_event_info_table(g_infotables.m_event_info) {}
sinsp_evt::sinsp_evt(sinsp *inspector): sinsp_evt() {
m_inspector = inspector;
}

sinsp_evt::~sinsp_evt() {
if(m_pevt_storage) {
Expand Down

0 comments on commit 4462fee

Please sign in to comment.