summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2017-12-14 21:36:31 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2017-12-15 10:11:15 +0000
commit9c5161aedff8e271cc036faeab58b665a3c8105e (patch)
treeee17e5e00c9a6ba72318f8f1ec186df2ac10e789 /src/vcl/vppcom.c
parent6390df300e6795e557f824e55b138837dabcf74b (diff)
VCL-LDPRELOAD: Fix Coverity Warning CID 178776
- Fix broken unit test code. - Check for NULL ptr in vppcom_session_attr() VPPCOM_ATTR_GET_*_ADDR endpoint parameters. Change-Id: I01169edce098ee855a9cba08893c2b08c93ea6c3 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index ce222a77234..2e3af1b3526 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -3797,7 +3797,7 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
break;
case VPPCOM_ATTR_GET_PEER_ADDR:
- if (buffer && buflen && (*buflen >= sizeof (*ep)))
+ if (buffer && buflen && (*buflen >= sizeof (*ep)) && ep->ip)
{
ep->vrf = session->vrf;
ep->is_ip4 = session->peer_addr.is_ip4;
@@ -3821,7 +3821,7 @@ vppcom_session_attr (uint32_t session_index, uint32_t op,
break;
case VPPCOM_ATTR_GET_LCL_ADDR:
- if (buffer && buflen && (*buflen >= sizeof (*ep)))
+ if (buffer && buflen && (*buflen >= sizeof (*ep)) && ep->ip)
{
ep->vrf = session->vrf;
ep->is_ip4 = session->lcl_addr.is_ip4;