From 44611e668c0c8fc316db7a65538b766e87043627 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 25 Nov 2024 13:56:31 +0100 Subject: [PATCH] Fix Segfault in MPI ReceiveMesh See https://github.com/NGSolve/netgen/issues/196 --- libsrc/meshing/parallelmesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/meshing/parallelmesh.cpp b/libsrc/meshing/parallelmesh.cpp index 997eaad5..e8fc71d7 100644 --- a/libsrc/meshing/parallelmesh.cpp +++ b/libsrc/meshing/parallelmesh.cpp @@ -1204,7 +1204,7 @@ namespace netgen auto write_names = [&] (auto & array) { for (int k = 0; k < array.Size(); k++) { int s = name_sizes[tot_nn]; - array[k] = new string(&compiled_names[tot_size], s); + array[k] = s ? new string(&compiled_names[tot_size], s) : nullptr; tot_nn++; tot_size += s; }