diff options
author | Steven <sluong@cisco.com> | 2017-11-08 14:14:45 -0800 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2017-11-12 03:32:44 +0000 |
commit | 0cdd5bd05bbb78c28a6995eff1d80eeabb9d6fd1 (patch) | |
tree | 991e9ac69b7c2c53dc2c8dca4bb54d44e1f39fa6 /src/vcl/vppcom.c | |
parent | b592ad758a10ad9a9cf8d4223b62eae2cf0515a1 (diff) |
VCL/LDPRELOAD: Fix out-of-bounds access and inequality comparison coverity errors
Fixed out-of-bounds access in vcom_socket.c by limiting the copy to the
size of the address field that was passed. Truncation will occur if
the address field is not big enough.
Fixed inequality comparison in vppcom.c by using the predefined macro
MAP_FAILED.
Change-Id: I9517c29ae811d08058621bd548a352b4d4f05139
Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r-- | src/vcl/vppcom.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 2382f29a2e1..a46bfe2d8db 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -1437,7 +1437,7 @@ defaulted: vcl_mem = mmap (0, vcl_cfg->heapsize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); - if (vcl_mem <= 0) + if (vcl_mem == MAP_FAILED) { clib_unix_error ("[%d] ERROR: mmap(0, %lld == 0x%llx, " "PROT_READ | PROT_WRITE,MAP_SHARED | MAP_ANONYMOUS, " |