summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallfro <ndouba@gmail.com>2011-07-29 09:11:49 -0300
committerallfro <ndouba@gmail.com>2011-07-29 09:11:49 -0300
commit31b83cb6c2591be2bd17416d82fcfdcacffb7141 (patch)
tree1347938d02bdfad9249fa25476b36b56b2f62ecb
parente20d0bcb9d3eed803bdcd547dbf88b1954204332 (diff)
downloadlibnet-31b83cb6c2591be2bd17416d82fcfdcacffb7141.tar.gz
Fixes improper calculation of header size when libnet_pblock_probe is called. payload_s must be added to the header length in order to accommodate for the existence of a non-NULL payload. Otherwise the user is prompted with a 'memcpy would cause overflow' error and the program exits.
-rw-r--r--libnet/src/libnet_build_hsrp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libnet/src/libnet_build_hsrp.c b/libnet/src/libnet_build_hsrp.c
index 7c03749..8f56945 100644
--- a/libnet/src/libnet_build_hsrp.c
+++ b/libnet/src/libnet_build_hsrp.c
@@ -57,7 +57,7 @@ const uint8_t *payload, uint32_t payload_s, libnet_t *l, libnet_ptag_t ptag)
* Find the existing protocol block if a ptag is specified, or create
* a new one.
*/
- p = libnet_pblock_probe(l, ptag, LIBNET_HSRP_H, LIBNET_PBLOCK_HSRP_H);
+ p = libnet_pblock_probe(l, ptag, LIBNET_HSRP_H + payload_s, LIBNET_PBLOCK_HSRP_H);
if (p == NULL)
{
return (-1);