Added null check in modules/ca/src/client/udpiiu.cpp to prevent possible dereferencing of null pointer. Flagged as error by Codacy static code analysis.

Codacy link: https://app.codacy.com/gh/epics-base/epics-base/file/42103575495/issues/source?bid=16430872&fileBranchId=16430872#l950
Launchpad bug: https://bugs.launchpad.net/epics-base/+bug/1862916

LP: #1862916
This commit is contained in:
Karl Vestin
2020-02-12 16:28:15 +01:00
committed by Michael Davidsaver
parent 66f2a509db
commit 2bcaa5448c

View File

@@ -946,7 +946,7 @@ bool udpiiu::pushDatagramMsg ( epicsGuard < epicsMutex > & guard,
caHdr * pbufmsg = ( caHdr * ) &this->xmitBuf[this->nBytesInXmitBuf];
*pbufmsg = msg;
if ( extsize ) {
if ( extsize && pExt ) {
memcpy ( pbufmsg + 1, pExt, extsize );
if ( extsize != alignedExtSize ) {
char *pDest = (char *) ( pbufmsg + 1 );