equal
deleted
inserted
replaced
|
1 To: [email protected] |
|
2 Subject: Patch 7.2.297 |
|
3 Fcc: outbox |
|
4 From: Bram Moolenaar <[email protected]> |
|
5 Mime-Version: 1.0 |
|
6 Content-Type: text/plain; charset=UTF-8 |
|
7 Content-Transfer-Encoding: 8bit |
|
8 ------------ |
|
9 |
|
10 Patch 7.2.297 |
|
11 Problem: Reading freed memory when writing ":reg" output to a register. |
|
12 (Dominique Pelle) |
|
13 Solution: Skip the register being written to. |
|
14 Files: src/ops.c |
|
15 |
|
16 |
|
17 *** ../vim-7.2.296/src/ops.c 2009-11-11 17:22:30.000000000 +0100 |
|
18 --- src/ops.c 2009-11-11 19:30:47.000000000 +0100 |
|
19 *************** |
|
20 *** 3991,3996 **** |
|
21 --- 3991,4004 ---- |
|
22 } |
|
23 else |
|
24 yb = &(y_regs[i]); |
|
25 + |
|
26 + #ifdef FEAT_EVAL |
|
27 + if (name == MB_TOLOWER(redir_reg) |
|
28 + || (redir_reg == '"' && yb == y_previous)) |
|
29 + continue; /* do not list register being written to, the |
|
30 + * pointer can be freed */ |
|
31 + #endif |
|
32 + |
|
33 if (yb->y_array != NULL) |
|
34 { |
|
35 msg_putchar('\n'); |
|
36 *************** |
|
37 *** 6090,6096 **** |
|
38 long maxlen; |
|
39 #endif |
|
40 |
|
41 ! if (y_ptr->y_array == NULL) /* NULL means emtpy register */ |
|
42 y_ptr->y_size = 0; |
|
43 |
|
44 /* |
|
45 --- 6098,6104 ---- |
|
46 long maxlen; |
|
47 #endif |
|
48 |
|
49 ! if (y_ptr->y_array == NULL) /* NULL means empty register */ |
|
50 y_ptr->y_size = 0; |
|
51 |
|
52 /* |
|
53 *** ../vim-7.2.296/src/version.c 2009-11-17 12:31:30.000000000 +0100 |
|
54 --- src/version.c 2009-11-17 12:42:28.000000000 +0100 |
|
55 *************** |
|
56 *** 683,684 **** |
|
57 --- 683,686 ---- |
|
58 { /* Add new patch number below this line */ |
|
59 + /**/ |
|
60 + 297, |
|
61 /**/ |
|
62 |
|
63 -- |
|
64 "Beware of bugs in the above code; I have only proved |
|
65 it correct, not tried it." -- Donald Knuth |
|
66 |
|
67 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ |
|
68 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
|
69 \\\ download, build and distribute -- http://www.A-A-P.org /// |
|
70 \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |