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>
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index ce222a7..2e3af1b 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -3797,7 +3797,7 @@
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 @@
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;