summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Popelka <jpopelka@redhat.com>2011-06-08 19:00:41 +0200
committerJiri Popelka <jpopelka@redhat.com>2011-06-08 19:00:41 +0200
commit51df9a2a6c7b82d2bdbd8593cbcb4d165689f07a (patch)
tree652693bfdb886a1e3038c669f1423247ff1b1d38
parent5d816a200c021a45641052cecc7a36f9f98eb561 (diff)
downloadlibnet-51df9a2a6c7b82d2bdbd8593cbcb4d165689f07a.tar.gz
Coverity: OVERRUN_STATIC
libnet_build_isl.c:76: overrun-buffer-arg: Overrunning static array "&isl_hdr.isl_dhost" of size 5 bytes by passing it to a function which indexes it with argument "6UL" at byte position 5.
-rw-r--r--libnet/src/libnet_build_isl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libnet/src/libnet_build_isl.c b/libnet/src/libnet_build_isl.c
index 588790b..e120eba 100644
--- a/libnet/src/libnet_build_isl.c
+++ b/libnet/src/libnet_build_isl.c
@@ -68,12 +68,12 @@ uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
}
memset(&isl_hdr, 0, sizeof (isl_hdr));
- memcpy(&isl_hdr.isl_dhost, dhost, 5);
+ memcpy(&isl_hdr.isl_dhost, dhost, sizeof(isl_hdr.isl_dhost));
isl_hdr.isl_type = type;
isl_hdr.isl_user = user;
- memcpy(&isl_hdr.isl_shost, shost, 6);
+ memcpy(&isl_hdr.isl_shost, shost, sizeof(isl_hdr.isl_shost));
isl_hdr.isl_len = htons(len);
- memcpy(&isl_hdr.isl_dhost, snap, 6);
+ memcpy(&isl_hdr.isl_dhost, snap, sizeof(isl_hdr.isl_dhost));
isl_hdr.isl_vid = htons(vid);
isl_hdr.isl_index = htons(portindex);
isl_hdr.isl_reserved= htons(reserved);