summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2018-06-20 07:14:49 -0400
committerGitHub <noreply@github.com>2018-06-20 07:14:49 -0400
commit9dbaf129b2fc2a454036c56af6871c5e24b9ec2c (patch)
treee4d858486aa9f4d4d32c3dba802fa8a0160a65f3
parent6e87c6e8e2481cf102c32374a6a7139031426831 (diff)
parent9ffaacb0f72901ee0def2e4a6f60361cb4eb6866 (diff)
Merge pull request #2446 from pacovn/Coverity_1452454_1452455_1452456_Out-of-bounds_access
ospfd: OoB access (Cov 1452454 1452455 1452456)
-rw-r--r--ospfd/ospf_ri.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ospfd/ospf_ri.c b/ospfd/ospf_ri.c
index 786b199029..93267156f2 100644
--- a/ospfd/ospf_ri.c
+++ b/ospfd/ospf_ri.c
@@ -516,12 +516,13 @@ static void unset_sr_node_msd(void)
TLV_LEN(OspfRI.sr_info.msd) = htons(0);
}
-static void unset_param(struct tlv_header *tlv)
+static void unset_param(void *tlv_buffer)
{
+ struct tlv_header *tlv = (struct tlv_header *)tlv_buffer;
tlv->type = 0;
/* Fill the Value to 0 */
- memset(TLV_DATA(tlv), 0, TLV_BODY_SIZE(tlv));
+ memset(TLV_DATA(tlv_buffer), 0, TLV_BODY_SIZE(tlv));
tlv->length = 0;
return;
@@ -1571,7 +1572,7 @@ DEFUN (no_pce_address,
"PCE address in IPv4 address format\n")
{
- unset_param(&OspfRI.pce_info.pce_address.header);
+ unset_param(&OspfRI.pce_info.pce_address);
/* Refresh RI LSA if already engaged */
if (CHECK_FLAG(OspfRI.flags, RIFLG_LSA_ENGAGED))
@@ -1621,7 +1622,7 @@ DEFUN (no_pce_path_scope,
"32-bit Hexadecimal value\n")
{
- unset_param(&OspfRI.pce_info.pce_address.header);
+ unset_param(&OspfRI.pce_info.pce_address);
/* Refresh RI LSA if already engaged */
if (CHECK_FLAG(OspfRI.flags, RIFLG_LSA_ENGAGED))
@@ -1810,7 +1811,7 @@ DEFUN (no_pce_cap_flag,
"Disable PCE capabilities\n")
{
- unset_param(&OspfRI.pce_info.pce_cap_flag.header);
+ unset_param(&OspfRI.pce_info.pce_cap_flag);
/* Refresh RI LSA if already engaged */
if (CHECK_FLAG(OspfRI.flags, RIFLG_LSA_ENGAGED))