Skip to content

Commit

Permalink
Avoid out-of-bound array access
Browse files Browse the repository at this point in the history
  • Loading branch information
nsavoire committed Jan 26, 2024
1 parent 7580455 commit c6d5a4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/unwind_dwfl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ void trace_unwinding_end(UnwindState *us) {
if (LL_DEBUG <= LOG_getlevel()) {
DsoHdr::DsoFindRes const find_res =
us->dso_hdr.dso_find_closest(us->pid, us->current_ip);
SymbolIdx_t const symIdx =
us->output.locs[us->output.locs.size() - 1]._symbol_idx;
if (find_res.second) {
if (find_res.second && !us->output.locs.empty()) {
SymbolIdx_t const symIdx =
us->output.locs[us->output.locs.size() - 1]._symbol_idx;
const std::string &last_func =
us->symbol_hdr._symbol_table[symIdx]._symname;
LG_DBG("Stopped at %lx - dso %s - error %s (%s)", us->current_ip,
Expand Down

0 comments on commit c6d5a4f

Please sign in to comment.