record: protect from NULL pointers
Even though the situation probably never happens, but better being extra cautious, just in case. | ../record/set.c: In function ‘IntervalListCreateSet’: | ../record/set.c:364:5: warning: use of NULL ‘stackIntervals’ where non-null expected [CWE-476] [-Wanalyzer-null-argument] | 364 | memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval)); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
2be4669988
commit
f1e7e52aa3
|
@ -888,7 +888,8 @@ RecordInstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient)
|
|||
unsigned int j;
|
||||
|
||||
for (j = interval.first; j <= interval.last; j++)
|
||||
pClient->requestVector[j] = RecordARequest;
|
||||
if (pClient)
|
||||
pClient->requestVector[j] = RecordARequest;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -361,7 +361,8 @@ IntervalListCreateSet(RecordSetInterval * pIntervals, int nIntervals,
|
|||
goto bailout;
|
||||
prls->baseSet.ops = &IntervalListSetOperations;
|
||||
}
|
||||
memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval));
|
||||
if (stackIntervals)
|
||||
memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval));
|
||||
prls->nIntervals = nIntervals;
|
||||
bailout:
|
||||
free(stackIntervals);
|
||||
|
|
Loading…
Reference in New Issue