Gentoo Archives: gentoo-commits

From: "Nathan Phillip Brink (binki)" <binki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-power/cpufreqd/files: cpufreqd-2.4.2-PATH_MAX.patch
Date: Sun, 30 Oct 2011 04:58:12
Message-Id: 20111030045801.E779B2004B@flycatcher.gentoo.org
1 binki 11/10/30 04:58:01
2
3 Added: cpufreqd-2.4.2-PATH_MAX.patch
4 Log:
5 Add patch from bug #318287 by Sven Eden <yamakuzure@×××.net> fixing glibc abort() for potential buffer overflow on startup when compiled with gcc-4.5 and CFLAGS="-O1" and passed the -f flag. OKed by steev_.
6
7 (Portage version: 2.2.0_alpha71-r1/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sys-power/cpufreqd/files/cpufreqd-2.4.2-PATH_MAX.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/cpufreqd/files/cpufreqd-2.4.2-PATH_MAX.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/cpufreqd/files/cpufreqd-2.4.2-PATH_MAX.patch?rev=1.1&content-type=text/plain
14
15 Index: cpufreqd-2.4.2-PATH_MAX.patch
16 ===================================================================
17 https://bugs.gentoo.org/318287: Fix buffer bound checks causing an
18 abort when -f commandline parameter is passed.
19
20 --- a/src/cpufreqd.h
21 +++ b/src/cpufreqd.h
22 @@ -54,6 +54,12 @@
23 #define DEFAULT_VERBOSITY 3
24
25 #define MAX_STRING_LEN 255
26 -#define MAX_PATH_LEN 512
27 +
28 +#ifdef HAVE_LIMITS_H
29 +#include <limits.h>
30 +#define MAX_PATH_LEN PATH_MAX
31 +#else
32 +#define MAX_PATH_LEN 512
33 +#endif
34
35 #endif /* __CPUFREQD_H__ */