avoid invalid calls to memcpy(): when ndot == 0, pointers may be NULL
This commit is contained in:
@ -461,7 +461,7 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
|
||||
largest = smaller;
|
||||
dim_select = dim;
|
||||
valuehalf_select = valuehalf;
|
||||
memcpy(dotmark_select,dotmark,ndot*sizeof(int));
|
||||
if (ndot > 0) memcpy(dotmark_select,dotmark,ndot*sizeof(int));
|
||||
}
|
||||
}
|
||||
|
||||
@ -469,7 +469,7 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
|
||||
|
||||
dim = dim_select;
|
||||
valuehalf = valuehalf_select;
|
||||
memcpy(dotmark,dotmark_select,ndot*sizeof(int));
|
||||
if (ndot > 0) memcpy(dotmark,dotmark_select,ndot*sizeof(int));
|
||||
|
||||
// found median
|
||||
// store cut info only if I am procmid
|
||||
|
||||
Reference in New Issue
Block a user