From 288ff8b62c9cbfe2c633870d43f6d71e4cc1f1d6 Mon Sep 17 00:00:00 2001 From: zhangzhangxin Date: Fri, 12 May 2023 14:48:49 +0800 Subject: [PATCH] sync:dhcp-lease: Avoid overflow in t2 computation Signed-off-by: zhangzhangxin --- ...ase-Avoid-overflow-in-t2-computation.patch | 26 +++++++++++++++++++ libell.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 0001-sync-dhcp-lease-Avoid-overflow-in-t2-computation.patch diff --git a/0001-sync-dhcp-lease-Avoid-overflow-in-t2-computation.patch b/0001-sync-dhcp-lease-Avoid-overflow-in-t2-computation.patch new file mode 100644 index 0000000..8aeb541 --- /dev/null +++ b/0001-sync-dhcp-lease-Avoid-overflow-in-t2-computation.patch @@ -0,0 +1,26 @@ +From 8c53b21d7ba7b1b2b2a8108c76d6ee935fee1639 Mon Sep 17 00:00:00 2001 +From: zhangzhangxin +Date: Fri, 12 May 2023 14:40:24 +0800 +Subject: [PATCH] sync:dhcp-lease: Avoid overflow in t2 computation + +Signed-off-by: zhangzhangxin +--- + ell/dhcp-lease.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ell/dhcp-lease.c b/ell/dhcp-lease.c +index 4d49190..e93c618 100644 +--- a/ell/dhcp-lease.c ++++ b/ell/dhcp-lease.c +@@ -151,7 +151,7 @@ struct l_dhcp_lease *_dhcp_lease_parse_options(struct dhcp_message_iter *iter) + lease->t1 = lease->lifetime / 2; + + if (!lease->t2) +- lease->t2 = lease->lifetime * 7 / 8; ++ lease->t2 = lease->lifetime / 8 * 7; + + if (lease->t1 > lease->t2) + goto error; +-- +2.40.0.windows.1 + diff --git a/libell.spec b/libell.spec index 4629a7b..8840c51 100644 --- a/libell.spec +++ b/libell.spec @@ -1,11 +1,12 @@ Name: libell Version: 0.32 -Release: 1 +Release: 2 Summary: Embedded Linux library License: LGPLv2+ URL: https://01.org/ell Source0: https://www.kernel.org/pub/linux/libs/ell/ell-%{version}.tar.xz BuildRequires: gcc +Patch0: 0001-sync-dhcp-lease-Avoid-overflow-in-t2-computation.patch %description The Embedded Linux* Library (ELL) provides core, low-level functionality forsystem daemons. It typically @@ -41,6 +42,9 @@ Header files for developing %{name}. %{_libdir}/pkgconfig/ell.pc %changelog +* Fri Mar 12 2023 zhangxin - 0.32-2 +- dhcp-lease:Avoid overflow in t2 computation + * Tue Aug 18 2020 wangye - 0.32-1 - update to 0.32 -- Gitee