diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-06-21 12:04:23 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-06-22 11:30:54 +0200 |
commit | b91b3d807d3e049358027d53ec5e4574e16850b3 (patch) | |
tree | 36f90bcd52da5dc69f51c4e79a65120506f7cb32 | |
parent | 364035c00258c17924174dac7921b5a8e68e6459 (diff) | |
download | nx-libs-b91b3d807d3e049358027d53ec5e4574e16850b3.tar.gz nx-libs-b91b3d807d3e049358027d53ec5e4574e16850b3.tar.bz2 nx-libs-b91b3d807d3e049358027d53ec5e4574e16850b3.zip |
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...
-rw-r--r-- | nx-X11/programs/Xserver/record/set.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nx-X11/programs/Xserver/record/set.c b/nx-X11/programs/Xserver/record/set.c index c3085c54d..3086f9670 100644 --- a/nx-X11/programs/Xserver/record/set.c +++ b/nx-X11/programs/Xserver/record/set.c @@ -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); |