summaryrefslogtreecommitdiff
path: root/ospf6d
diff options
context:
space:
mode:
authormobash-rasool <mobash.rasool@gmail.com>2022-06-24 17:23:31 +0530
committerGitHub <noreply@github.com>2022-06-24 17:23:31 +0530
commit8771cdcb94454164a2067306a16a81c543dec1fb (patch)
tree66688c03f95759a152ad6814a0c3f4dc8c357895 /ospf6d
parentaaa331923d48d95335783163b401e675cf8ebcc1 (diff)
parentf4e8f5d496e54a55d0366b8fd7557f5bd65a0f2e (diff)
Merge pull request #11462 from donaldsharp/random_stuff_right
Random stuff right
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_auth_trailer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ospf6d/ospf6_auth_trailer.c b/ospf6d/ospf6_auth_trailer.c
index 77ac4a1877..e54f6784e8 100644
--- a/ospf6d/ospf6_auth_trailer.c
+++ b/ospf6d/ospf6_auth_trailer.c
@@ -120,7 +120,13 @@ void ospf6_auth_hdr_dump_recv(struct ospf6_header *ospfh, uint16_t length,
ospf6_at_hdr =
(struct ospf6_auth_hdr *)((uint8_t *)ospfh + oh_len);
at_hdr_len = ntohs(ospf6_at_hdr->length);
- hash_len = at_hdr_len - OSPF6_AUTH_HDR_MIN_SIZE;
+ hash_len = at_hdr_len - (uint16_t)OSPF6_AUTH_HDR_MIN_SIZE;
+ if (hash_len > KEYCHAIN_MAX_HASH_SIZE) {
+ zlog_debug(
+ "Specified value for hash_len %u is greater than expected %u",
+ hash_len, KEYCHAIN_MAX_HASH_SIZE);
+ return;
+ }
memcpy(temp, ospf6_at_hdr->data, hash_len);
temp[hash_len] = '\0';
zlog_debug("OSPF6 Authentication Trailer");