openntpd: fix integer overflow on i686

This commit is contained in:
Michael Laß 2023-09-09 12:12:38 +02:00 committed by Leah Neukirchen
parent 348bebe43d
commit 64e827d718
2 changed files with 13 additions and 1 deletions

View file

@ -0,0 +1,12 @@
--- a/src/constraint.c
+++ b/src/constraint.c
@@ -842,7 +842,7 @@ constraint_update(void)
/* calculate median */
i = cnt / 2;
if (cnt % 2 == 0)
- conf->constraint_median = (values[i - 1] + values[i]) / 2;
+ conf->constraint_median = ((long long)values[i - 1] + values[i]) / 2;
else
conf->constraint_median = values[i];

View file

@ -1,7 +1,7 @@
# Template file for 'openntpd'
pkgname=openntpd
version=6.8p1
revision=4
revision=5
build_style=gnu-configure
configure_args="--with-privsep-user=openntpd --with-cacert=/etc/ssl/certs.pem"
hostmakedepends="automake libtool"