diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2017-10-26 14:47:06 -0400 |
---|---|---|
committer | Chris Luke <chris_luke@comcast.com> | 2017-10-26 21:22:58 +0000 |
commit | 617dffaee47fc6fbc0dca85dc07c53ca9b57bf90 (patch) | |
tree | 3feaa2d422b4c6e7baf7867328d1be74b51d713e /src/vcl/vppcom.c | |
parent | 8184ebd1dae921489cb494e32f026886a1990b6a (diff) |
VCL-LDPRELOAD: Fix CID 178251 & CID 178253
- CID 178251 Dereference after null check in vcom_socket.c
- CID 178253 Logically dead code in vppcom.c
Change-Id: I2a24cd53727fec76cf1a6d60f90414ff92567818
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r-- | src/vcl/vppcom.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 72b5277c85c..75e86c843cc 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -3445,16 +3445,26 @@ int vppcom_session_sendto (uint32_t session_index, void *buffer, uint32_t buflen, int flags, vppcom_endpt_t * ep) { + vppcom_main_t *vcm = &vppcom_main; + + if (!buffer) + return VPPCOM_EINVAL; + if (ep) - // TBD - return -1; - else if (flags == 0) - return (vppcom_session_write (session_index, buffer, buflen)); - else if (flags) - // TBD check the flags and do the right thing - return (vppcom_session_write (session_index, buffer, buflen)); - - return -1; + { + // TBD + return VPPCOM_EINVAL; + } + + if (flags) + { + // TBD check the flags and do the right thing + if (VPPCOM_DEBUG > 2) + clib_warning ("[%d] handling flags 0x%u (%d) not implemented yet.", + vcm->my_pid, flags, flags); + } + + return (vppcom_session_write (session_index, buffer, buflen)); } /* |