diff --git a/libsrc/general/table.cpp b/libsrc/general/table.cpp index 732d63c3..18d9cf7e 100644 --- a/libsrc/general/table.cpp +++ b/libsrc/general/table.cpp @@ -108,8 +108,9 @@ namespace netgen if (line.size == line.maxsize) { void * p = new char [(line.maxsize+5) * elsize]; - - memcpy (p, line.col, line.maxsize * elsize); + + if (line.maxsize*elsize) + memcpy (p, line.col, line.maxsize * elsize); delete [] (char*)line.col; line.col = p; diff --git a/libsrc/linalg/densemat.cpp b/libsrc/linalg/densemat.cpp index f2cc2fa5..06b8c257 100644 --- a/libsrc/linalg/densemat.cpp +++ b/libsrc/linalg/densemat.cpp @@ -49,7 +49,8 @@ namespace netgen { data = NULL; height = width = 0; SetSize (m2.Height(), m2.Width()); - memcpy (data, m2.data, sizeof(double) * Height() * Width()); + if (Height()*Width()) + memcpy (data, m2.data, sizeof(double) * (Height() * Width())); } DenseMatrix :: ~DenseMatrix ()