Skip to content

Fix possibly invalid pointer#231

Merged
Algiane merged 4 commits intodevelopfrom
feature/fix-invalid-pointer
Dec 5, 2023
Merged

Fix possibly invalid pointer#231
Algiane merged 4 commits intodevelopfrom
feature/fix-invalid-pointer

Conversation

@Algiane
Copy link
Copy Markdown
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
@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