!10 sync:Avoid overflow in t2 computation

From: @zhangzhangxin 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-05-12 09:00:27 +00:00 committed by Gitee
commit 860e769f5f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From 8c53b21d7ba7b1b2b2a8108c76d6ee935fee1639 Mon Sep 17 00:00:00 2001
From: zhangzhangxin <zhangxin1@xfusion.com>
Date: Fri, 12 May 2023 14:40:24 +0800
Subject: [PATCH] sync:dhcp-lease: Avoid overflow in t2 computation
Signed-off-by: zhangzhangxin <zhangxin1@xfusion.com>
---
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

View File

@ -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 <zhangxin1@xfusion.com> - 0.32-2
- dhcp-lease:Avoid overflow in t2 computation
* Tue Aug 18 2020 wangye <wangye70@huawei.com> - 0.32-1
- update to 0.32