Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possibly invalid pointer #231

Merged
merged 4 commits into from
Dec 5, 2023
Merged

Conversation

Algiane
Copy link
Member

@Algiane Algiane commented Dec 5, 2023

This PR Fixes:

  • a possible invalid pointer in MMG3D_movbdyregpt_iso after the reallocation of the xpoint array by the MMG3D_movbdyregpt_geom function (see ls-CenIn-DisOut-8 ParMmg continuous test for example);
  • a possible memory error when deleting all the tetra/points from the mesh (for example in the keep_only1subdomain function, see mmg3d_hybrid-nsd1 continuous integration test case)

It reports this last fix inside the MMG[2D|S]_del[Pt|Elt] functions.

Fix possible invalid pointer in MMG3D_movbdyregpt_iso after the reallocation of the xpoint array by the MMG3D_movbdyregpt_geom function.
@Algiane Algiane added kind: bug error or fault part: mmg3d mmg3d specific priority: high linked to blocking behaviour or to a close deadline labels Dec 5, 2023
@Algiane Algiane self-assigned this Dec 5, 2023
If all tetra (resp. points) are deleted, the last deletion (iel == mesh->ne)
 leads to mesh->ne = -1 (resp. mesh->np = -1) and to a memory error
 if we don't add a security guard.

See for example the `mmg3d_hybrid-nsd1` continuous integration test with
PATTERN and SCOTCH options setted to off.
@Algiane Algiane merged commit 89d537a into develop Dec 5, 2023
45 checks passed
@Algiane Algiane deleted the feature/fix-invalid-pointer branch December 5, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug error or fault part: mmg3d mmg3d specific priority: high linked to blocking behaviour or to a close deadline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant