[X2Go-Commits] [nx-libs] 115/219: record/set.c: silence cpp finding

git-admin at x2go.org git-admin at x2go.org
Sat Sep 28 12:10:33 CEST 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit b91b3d807d3e049358027d53ec5e4574e16850b3
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Fri Jun 21 12:04:23 2019 +0200

    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...
---
 nx-X11/programs/Xserver/record/set.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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);

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list