dataoffset = 0; /* marker for no null bitmap */
nbytes += ARR_OVERHEAD_NONULLS(ndim);
}
- retval = (ArrayType *) palloc(nbytes);
+ retval = (ArrayType *) palloc0(nbytes);
SET_VARSIZE(retval, nbytes);
retval->ndim = ndim;
retval->dataoffset = dataoffset;
bytes += ARR_OVERHEAD_NONULLS(ndim);
}
- newarray = (ArrayType *) palloc(bytes);
+ newarray = (ArrayType *) palloc0(bytes);
SET_VARSIZE(newarray, bytes);
newarray->ndim = ndim;
newarray->dataoffset = dataoffset;
/*
* OK, create the new array and fill in header/dimensions
*/
- newarray = (ArrayType *) palloc(newsize);
+ newarray = (ArrayType *) palloc0(newsize);
SET_VARSIZE(newarray, newsize);
newarray->ndim = ndim;
newarray->dataoffset = newhasnulls ? overheadlen : 0;
newsize = overheadlen + olddatasize - olditemsize + newitemsize;
- newarray = (ArrayType *) palloc(newsize);
+ newarray = (ArrayType *) palloc0(newsize);
SET_VARSIZE(newarray, newsize);
newarray->ndim = ndim;
newarray->dataoffset = newhasnulls ? overheadlen : 0;
dataoffset = 0; /* marker for no null bitmap */
nbytes += ARR_OVERHEAD_NONULLS(ndim);
}
- result = (ArrayType *) palloc(nbytes);
+ result = (ArrayType *) palloc0(nbytes);
SET_VARSIZE(result, nbytes);
result->ndim = ndim;
result->dataoffset = dataoffset;
dataoffset = 0; /* marker for no null bitmap */
nbytes += ARR_OVERHEAD_NONULLS(ndims);
}
- result = (ArrayType *) palloc(nbytes);
+ result = (ArrayType *) palloc0(nbytes);
SET_VARSIZE(result, nbytes);
result->ndim = ndims;
result->dataoffset = dataoffset;
{
ArrayType *result;
- result = (ArrayType *) palloc(sizeof(ArrayType));
+ result = (ArrayType *) palloc0(sizeof(ArrayType));
SET_VARSIZE(result, sizeof(ArrayType));
result->ndim = 0;
result->dataoffset = 0;
SET_VARSIZE(path, size);
path->npts = npts;
path->closed = (closed ? 1 : 0);
+ /* prevent instability in unused pad bytes */
+ path->dummy = 0;
for (i = 0; i < npts; i++)
{
SET_VARSIZE(result, size);
result->npts = (p1->npts + p2->npts);
result->closed = p1->closed;
+ /* prevent instability in unused pad bytes */
+ result->dummy = 0;
for (i = 0; i < p1->npts; i++)
{
SET_VARSIZE(path, size);
path->npts = poly->npts;
path->closed = TRUE;
+ /* prevent instability in unused pad bytes */
+ path->dummy = 0;
for (i = 0; i < poly->npts; i++)
{