Skip to content

Commit

Permalink
Added null check in modules/ca/src/client/udpiiu.cpp to prevent possi…
Browse files Browse the repository at this point in the history
…ble 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
  • Loading branch information
Karl Vestin authored and mdavidsaver committed Feb 13, 2020
1 parent 66f2a50 commit 2bcaa54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/ca/src/client/udpiiu.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 2bcaa54

Please sign in to comment.