Skip to content

Commit

Permalink
fix(sinsp): guard against uninitialized use
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Roberts <[email protected]>
  • Loading branch information
Adam Roberts authored and Adam Roberts committed Jan 25, 2025
1 parent 6c46ed3 commit 8e2e6ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions userspace/libsinsp/sinsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,7 @@ void sinsp::get_capture_stats(scap_stats* stats) const {
}

void sinsp::print_capture_stats(sinsp_logger::severity sev) const {
scap_stats stats;
scap_stats stats = {};

Check warning on line 1682 in userspace/libsinsp/sinsp.cpp

View check run for this annotation

Codecov / codecov/patch

userspace/libsinsp/sinsp.cpp#L1682

Added line #L1682 was not covered by tests
get_capture_stats(&stats);

libsinsp_logger()->format(
Expand Down Expand Up @@ -1822,7 +1822,7 @@ void sinsp::get_read_progress_plugin(double* nres, std::string* sres) const {
return;
}

uint32_t nplg;
uint32_t nplg = 0;

Check warning on line 1825 in userspace/libsinsp/sinsp.cpp

View check run for this annotation

Codecov / codecov/patch

userspace/libsinsp/sinsp.cpp#L1825

Added line #L1825 was not covered by tests
*sres = m_input_plugin->get_progress(nplg);

*nres = ((double)nplg) / 100;
Expand Down

0 comments on commit 8e2e6ae

Please sign in to comment.