aboutsummaryrefslogtreecommitdiffstats
path: root/main/quagga/0001-nhrpd-change-ipsec-SA-count-to-32-bit.patch
blob: 79ecaebfb3dab2df5924d3f7b1ab5e517dc0b50c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From fc6fefacad2a82f1d0470ba73015e117076b6116 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Sun, 19 Jul 2020 18:07:31 +0300
Subject: [PATCH] nhrpd: change ipsec SA count to 32-bit

Under certain misconfigurations, the SA count can be unusually high
and wrap 8-bit counter. That leads to premature free, and crash.
Make the count 32-bit to avoid crash in these rare conditions.
---
 nhrpd/nhrpd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nhrpd/nhrpd.h b/nhrpd/nhrpd.h
index 9222ad4e..7c73717f 100644
--- a/nhrpd/nhrpd.h
+++ b/nhrpd/nhrpd.h
@@ -123,7 +123,7 @@ enum nhrp_notify_type {
 
 struct nhrp_vc {
 	struct notifier_list notifier_list;
-	uint8_t ipsec;
+	uint32_t ipsec;
 	uint8_t updating;
 	uint8_t abort_migration;
 
-- 
2.27.0