mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-27 21:30:35 +05:00
check for num=0 before memcpy
This commit is contained in:
parent
22797971f6
commit
a86d231714
@ -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;
|
||||
|
@ -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 ()
|
||||
|
Loading…
Reference in New Issue
Block a user