Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37580051
en ru br
ALT Linux repositórios
S:4.4.3.P1-alt1
5.0: 3.0.7-alt1
4.1: 3.0.6-alt2.M41.1
4.0: 3.0.6-alt1
3.0: 3.0.2-alt1

Group :: Sistema/Servidores
RPM: dhcp

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: 0025-Apply-dhcp-4.3.5-bound.diff.patch
Download


From 0 Mon Sep 17 00:00:00 2001
From: Mikhail Efremov <sem@altlinux.org>
Date: Wed, 30 Aug 2017 17:27:44 +0300
Subject: [PATCH 25] Apply dhcp-4.3.5-bound.diff
Thanks gremlin@.
diff --git a/dhcp/omapip/hash.c b/dhcp/omapip/hash.c
index defaced..defaced 100644
--- a/dhcp/omapip/hash.c
+++ b/dhcp/omapip/hash.c
@@ -343,10 +343,15 @@ do_ip4_hash(const void *key, unsigned len, unsigned size)
 unsigned char *
 hash_report(struct hash_table *table)
 {
+
+#define INT32_MAX_N 2147483647	/* 0x7FFFFFFF */
+#define INT32_MAX_S "2147483647"
+
 	static unsigned char retbuf[sizeof("Contents/Size (%): "
-					   "2147483647/2147483647 "
-					   "(2147483647%). "
-					   "Min/max: 2147483647/2147483647")];
+					   INT32_MAX_S "/ " INT32_MAX_S
+					   "(" INT32_MAX_S "%). "
+					   "Min/max: "
+					   INT32_MAX_S "/" INT32_MAX_S)];
 	unsigned curlen, pct, contents=0, minlen=UINT_MAX, maxlen=0;
 	unsigned i;
 	struct hash_bucket *bp;
@@ -379,11 +384,11 @@ hash_report(struct hash_table *table)
 	else
 		pct = (contents * 100) / table->hash_count;
 
-	if (contents > 2147483647 ||
-	    table->hash_count > 2147483647 ||
-	    pct > 2147483647 ||
-	    minlen > 2147483647 ||
-	    maxlen > 2147483647)
+	if (contents > (INT32_MAX_N - 1) ||
+	    table->hash_count > (INT32_MAX_N - 1) ||
+	    pct > (INT32_MAX_N - 1) ||
+	    minlen > (INT32_MAX_N - 1) ||
+	    maxlen > (INT32_MAX_N - 1))
 		return (unsigned char *) "Report out of range for display.";
 
 	sprintf((char *)retbuf,
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009