Skip to content

Commit

Permalink
Check that ir is not -1 for region dose scoring
Browse files Browse the repository at this point in the history
Before this change, there was an out-of-bounds read in d_reg_index when
the region index was -1 (outside the geometry).
  • Loading branch information
mxxo authored and ftessier committed Jun 27, 2022
1 parent a6fc389 commit b6ea5dc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class EGS_DOSE_SCORING_EXPORT EGS_DoseScoring : public EGS_AusgabObject {
}

/*** Check if scoring in current region ***/
if (dose) {
if (ir >= 0 && dose) {
if (d_reg_index[ir]<0) {
return 0;
}
Expand Down Expand Up @@ -247,7 +247,7 @@ class EGS_DOSE_SCORING_EXPORT EGS_DoseScoring : public EGS_AusgabObject {
}

/*** Check if scoring in current region ***/
if (dose) {
if (ir >= 0 && dose) {
if (d_reg_index[ir]<0) {
return 0;
}
Expand Down

0 comments on commit b6ea5dc

Please sign in to comment.