From: | "Harald van Dijk (truedfx)" <truedfx@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in sys-devel/dev86/files: dev86-0.16.17-fortify.patch |
Date: | Mon, 02 Feb 2009 19:02:29 |
Message-Id: | E1LU43v-0002es-Bm@stork.gentoo.org |
1 | truedfx 09/02/02 19:02:27 |
2 | |
3 | Added: dev86-0.16.17-fortify.patch |
4 | Log: |
5 | Fix possible buffer overflow (#256782) |
6 | (Portage version: 2.2_rc23/cvs/Linux x86_64) |
7 | |
8 | Revision Changes Path |
9 | 1.1 sys-devel/dev86/files/dev86-0.16.17-fortify.patch |
10 | |
11 | file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/dev86/files/dev86-0.16.17-fortify.patch?rev=1.1&view=markup |
12 | plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/dev86/files/dev86-0.16.17-fortify.patch?rev=1.1&content-type=text/plain |
13 | |
14 | Index: dev86-0.16.17-fortify.patch |
15 | =================================================================== |
16 | --- dev86-0.16.17/bcc/bcc.c |
17 | +++ dev86-0.16.17/bcc/bcc.c |
18 | @@ -19,6 +19,7 @@ |
19 | #ifdef __STDC__ |
20 | #include <stdlib.h> |
21 | #ifndef MSDOS |
22 | +#include <limits.h> |
23 | #include <unistd.h> |
24 | #endif |
25 | #else |
26 | @@ -596,12 +597,17 @@ |
27 | } |
28 | } |
29 | |
30 | -void |
31 | -command_reset() |
32 | -{ |
33 | #ifndef MAXPATHLEN |
34 | +#ifdef PATH_MAX |
35 | +#define MAXPATHLEN PATH_MAX |
36 | +#else |
37 | #define MAXPATHLEN 1024 |
38 | #endif |
39 | +#endif |
40 | + |
41 | +void |
42 | +command_reset() |
43 | +{ |
44 | char buf[MAXPATHLEN]; |
45 | char ** prefix; |
46 | char * saved_cmd; |
47 | @@ -1308,11 +1314,7 @@ |
48 | |
49 | for(d=s=ptr; d && *s; s=d) |
50 | { |
51 | -#ifdef MAXPATHLEN |
52 | char buf[MAXPATHLEN]; |
53 | -#else |
54 | - char buf[1024]; |
55 | -#endif |
56 | |
57 | free(temp); |
58 | d=strchr(s, ':'); |