Skip to content

Commit

Permalink
Fix invalid string access in BoundaryLayerTool
Browse files Browse the repository at this point in the history
When AddFaceDescriptor reallocates the array the fd reference becomes
dangling.

See NGSolve#203
  • Loading branch information
StefanBruens committed Dec 20, 2024
1 parent 975414c commit 8cb4518
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libsrc/meshing/boundarylayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,8 @@ namespace netgen
new_fd.SetBCProperty(new_si);
mesh.AddFaceDescriptor(new_fd);
si_map[facei] = new_si;
mesh.SetBCName(new_si-1, fd.GetBCName());
// AddFaceDescriptor may reallocate, fd is invalidated
mesh.SetBCName(new_si-1, mesh.GetFaceDescriptor(facei).GetBCName());
face_done.SetBit(facei);
}
}
Expand Down

0 comments on commit 8cb4518

Please sign in to comment.