summaryrefslogtreecommitdiffstats
path: root/vi/vim-7.2/7.2.044
blob: 4cfe651e243e56038187f6fe18a664a6d594b62b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
To: vim-dev@vim.org
Subject: Patch 7.2.044
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.044
Problem:    Crash because of STRCPY() being over protective of the destination
	    size. (Dominique Pelle)
Solution:   Add -D_FORTIFY_SOURCE=1 to CFLAGS.  Use an intermediate variable
	    for the pointer to avoid a warning.
Files:	    src/auto/configure, src/configure.in, src/eval.c


*** ../vim-7.2.043/src/auto/configure	Thu Jul 24 17:20:50 2008
--- src/auto/configure	Sun Nov 16 17:08:44 2008
***************
*** 16819,16839 ****
    LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
  fi
  
- { $as_echo "$as_me:$LINENO: checking for GCC 3 or later" >&5
- $as_echo_n "checking for GCC 3 or later... " >&6; }
  DEPEND_CFLAGS_FILTER=
  if test "$GCC" = yes; then
    gccmajor=`echo "$gccversion" | sed -e 's/^\([1-9]\)\..*$/\1/g'`
    if test "$gccmajor" -gt "2"; then
      DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
!   fi
! fi
! if test "$DEPEND_CFLAGS_FILTER" = ""; then
!   { $as_echo "$as_me:$LINENO: result: no" >&5
  $as_echo "no" >&6; }
! else
!   { $as_echo "$as_me:$LINENO: result: yes" >&5
  $as_echo "yes" >&6; }
  fi
  
  
--- 16819,16847 ----
    LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
  fi
  
  DEPEND_CFLAGS_FILTER=
  if test "$GCC" = yes; then
+   { $as_echo "$as_me:$LINENO: checking for GCC 3 or later" >&5
+ $as_echo_n "checking for GCC 3 or later... " >&6; }
    gccmajor=`echo "$gccversion" | sed -e 's/^\([1-9]\)\..*$/\1/g'`
    if test "$gccmajor" -gt "2"; then
      DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
!     { $as_echo "$as_me:$LINENO: result: yes" >&5
! $as_echo "yes" >&6; }
!   else
!     { $as_echo "$as_me:$LINENO: result: no" >&5
  $as_echo "no" >&6; }
!   fi
!       { $as_echo "$as_me:$LINENO: checking whether we need -D_FORTIFY_SOURCE=1" >&5
! $as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; }
!   if test "$gccmajor" -gt "3"; then
!     CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1"
!     { $as_echo "$as_me:$LINENO: result: yes" >&5
  $as_echo "yes" >&6; }
+   else
+     { $as_echo "$as_me:$LINENO: result: no" >&5
+ $as_echo "no" >&6; }
+   fi
  fi
  
  
*** ../vim-7.2.043/src/configure.in	Thu Jul 24 17:20:31 2008
--- src/configure.in	Sun Nov 16 17:08:40 2008
***************
*** 3152,3169 ****
  dnl But only when making dependencies, cproto and lint don't take "-isystem".
  dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow
  dnl the number before the version number.
- AC_MSG_CHECKING(for GCC 3 or later)
  DEPEND_CFLAGS_FILTER=
  if test "$GCC" = yes; then
    gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'`
    if test "$gccmajor" -gt "2"; then
      DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
    fi
- fi
- if test "$DEPEND_CFLAGS_FILTER" = ""; then
-   AC_MSG_RESULT(no)
- else
-   AC_MSG_RESULT(yes)
  fi
  AC_SUBST(DEPEND_CFLAGS_FILTER)
  
--- 3152,3176 ----
  dnl But only when making dependencies, cproto and lint don't take "-isystem".
  dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow
  dnl the number before the version number.
  DEPEND_CFLAGS_FILTER=
  if test "$GCC" = yes; then
+   AC_MSG_CHECKING(for GCC 3 or later)
    gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'`
    if test "$gccmajor" -gt "2"; then
      DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
+     AC_MSG_RESULT(yes)
+   else
+     AC_MSG_RESULT(no)
+   fi
+   dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is
+   dnl declared as char x[1] but actually longer.  Introduced in gcc 4.0.
+   AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1)
+   if test "$gccmajor" -gt "3"; then
+     CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1"
+     AC_MSG_RESULT(yes)
+   else
+     AC_MSG_RESULT(no)
    fi
  fi
  AC_SUBST(DEPEND_CFLAGS_FILTER)
  
*** ../vim-7.2.043/src/eval.c	Wed Nov 12 15:28:37 2008
--- src/eval.c	Sun Nov 16 20:46:28 2008
***************
*** 21150,21157 ****
      init_var_dict(&fc.l_avars, &fc.l_avars_var);
      add_nr_var(&fc.l_avars, &fc.fixvar[fixvar_idx++].var, "0",
  				(varnumber_T)(argcount - fp->uf_args.ga_len));
      v = &fc.fixvar[fixvar_idx++].var;
!     STRCPY(v->di_key, "000");
      v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX;
      hash_add(&fc.l_avars.dv_hashtab, DI2HIKEY(v));
      v->di_tv.v_type = VAR_LIST;
--- 21150,21160 ----
      init_var_dict(&fc.l_avars, &fc.l_avars_var);
      add_nr_var(&fc.l_avars, &fc.fixvar[fixvar_idx++].var, "0",
  				(varnumber_T)(argcount - fp->uf_args.ga_len));
+     /* Use "name" to avoid a warning from some compiler that checks the
+      * destination size. */
      v = &fc.fixvar[fixvar_idx++].var;
!     name = v->di_key;
!     STRCPY(name, "000");
      v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX;
      hash_add(&fc.l_avars.dv_hashtab, DI2HIKEY(v));
      v->di_tv.v_type = VAR_LIST;
*** ../vim-7.2.043/src/version.c	Thu Nov 20 10:26:19 2008
--- src/version.c	Thu Nov 20 10:34:31 2008
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     44,
  /**/

-- 
Error:015 - Unable to exit Windows.  Try the door.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///