mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
fix range-check exception for 0-sized array
This commit is contained in:
parent
41bd58dd31
commit
bac314a666
@ -723,7 +723,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
|||||||
strs = geom_part_string.size();
|
strs = geom_part_string.size();
|
||||||
// buf = new char[strs];
|
// buf = new char[strs];
|
||||||
buf.SetSize(strs);
|
buf.SetSize(strs);
|
||||||
memcpy(&buf[0], geom_part_string.c_str(), strs*sizeof(char));
|
memcpy(buf.Data(), geom_part_string.c_str(), strs*sizeof(char));
|
||||||
delete infile;
|
delete infile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -810,7 +810,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
|||||||
|
|
||||||
shared_ptr<NetgenGeometry> geo;
|
shared_ptr<NetgenGeometry> geo;
|
||||||
if(buf.Size()) { // if we had geom-info in the file, take it
|
if(buf.Size()) { // if we had geom-info in the file, take it
|
||||||
istringstream geom_infile(string((const char*)&buf[0], buf.Size()));
|
istringstream geom_infile(string((const char*)buf.Data(), buf.Size()));
|
||||||
geo = geometryregister.LoadFromMeshFile(geom_infile);
|
geo = geometryregister.LoadFromMeshFile(geom_infile);
|
||||||
}
|
}
|
||||||
if(geo!=nullptr) mesh->SetGeometry(geo);
|
if(geo!=nullptr) mesh->SetGeometry(geo);
|
||||||
|
Loading…
Reference in New Issue
Block a user