Commit b91b3d80 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

record/set.c: silence cpp finding

[nx-X11/programs/Xserver/record/set.c:361]: (warning) Possible null pointer dereference: stackIntervals stackIntervals is only NULL if nIntervals is 0, too. In that case memcpy will do nothing and so it is ok to pass NULL as source. But it is ugly nevertheless...
parent 364035c0
......@@ -357,7 +357,8 @@ IntervalListCreateSet(RecordSetInterval *pIntervals, int nIntervals,
if (!prls) goto bailout;
prls->baseSet.ops = &IntervalListSetOperations;
}
memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval));
if (nIntervals > 0)
memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval));
prls->nIntervals = nIntervals;
bailout:
if (stackIntervals) free(stackIntervals);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment