]> git.pld-linux.org Git - packages/vim.git/blame - 7.3.661
- add patches 7.3.619-743
[packages/vim.git] / 7.3.661
CommitLineData
5a088057
KK
1To: vim_dev@googlegroups.com
2Subject: Patch 7.3.661
3Fcc: outbox
4From: Bram Moolenaar <Bram@moolenaar.net>
5Mime-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8------------
9
10Patch 7.3.661 (after 7.3.652)
11Problem: SEGV in Python code.
12Solution: Initialize len to zero. Use the right function depending on
13 version. (Maxim Philippov)
14Files: src/if_py_both.h, src/if_python.c, src/if_python3.c
15
16
17*** ../vim-7.3.660/src/if_py_both.h 2012-09-05 19:09:06.000000000 +0200
18--- src/if_py_both.h 2012-09-12 19:50:07.000000000 +0200
19***************
20*** 74,80 ****
21 static PyObject *
22 OutputWrite(PyObject *self, PyObject *args)
23 {
24! Py_ssize_t len;
25 char *str = NULL;
26 int error = ((OutputObject *)(self))->error;
27
28--- 74,80 ----
29 static PyObject *
30 OutputWrite(PyObject *self, PyObject *args)
31 {
32! Py_ssize_t len = 0;
33 char *str = NULL;
34 int error = ((OutputObject *)(self))->error;
35
36*** ../vim-7.3.660/src/if_python.c 2012-09-05 19:03:51.000000000 +0200
37--- src/if_python.c 2012-09-12 19:52:10.000000000 +0200
38***************
39*** 44,51 ****
40 # undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */
41 #endif
42
43- #define PY_SSIZE_T_CLEAN
44-
45 #include <Python.h>
46 #if defined(MACOS) && !defined(MACOS_X_UNIX)
47 # include "macglue.h"
48--- 44,49 ----
49***************
50*** 54,59 ****
51--- 52,61 ----
52 #undef main /* Defined in python.h - aargh */
53 #undef HAVE_FCNTL_H /* Clash with os_win32.h */
54
55+ #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
56+ # define PY_SSIZE_T_CLEAN
57+ #endif
58+
59 static void init_structs(void);
60
61 #define PyBytes_FromString PyString_FromString
62***************
63*** 358,365 ****
64--- 360,374 ----
65 PYTHON_PROC *ptr;
66 } python_funcname_table[] =
67 {
68+ #ifndef PY_SSIZE_T_CLEAN
69 {"PyArg_Parse", (PYTHON_PROC*)&dll_PyArg_Parse},
70 {"PyArg_ParseTuple", (PYTHON_PROC*)&dll_PyArg_ParseTuple},
71+ {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
72+ #else
73+ {"_PyArg_Parse_SizeT", (PYTHON_PROC*)&dll_PyArg_Parse},
74+ {"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&dll_PyArg_ParseTuple},
75+ {"_Py_BuildValue_SizeT", (PYTHON_PROC*)&dll_Py_BuildValue},
76+ #endif
77 {"PyMem_Free", (PYTHON_PROC*)&dll_PyMem_Free},
78 {"PyMem_Malloc", (PYTHON_PROC*)&dll_PyMem_Malloc},
79 {"PyDict_SetItemString", (PYTHON_PROC*)&dll_PyDict_SetItemString},
80***************
81*** 422,428 ****
82 {"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv},
83 {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type},
84 {"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready},
85- {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
86 {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
87 # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \
88 && SIZEOF_SIZE_T != SIZEOF_INT
89--- 431,436 ----
90*** ../vim-7.3.660/src/if_python3.c 2012-09-05 19:09:06.000000000 +0200
91--- src/if_python3.c 2012-09-12 19:52:10.000000000 +0200
92***************
93*** 42,49 ****
94 # undef _DEBUG
95 #endif
96
97- #define PY_SSIZE_T_CLEAN
98-
99 #ifdef F_BLANK
100 # undef F_BLANK
101 #endif
102--- 42,47 ----
103***************
104*** 66,71 ****
105--- 64,73 ----
106 #undef main /* Defined in python.h - aargh */
107 #undef HAVE_FCNTL_H /* Clash with os_win32.h */
108
109+ #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
110+ # define PY_SSIZE_T_CLEAN
111+ #endif
112+
113 static void init_structs(void);
114
115 /* The "surrogateescape" error handler is new in Python 3.1 */
116***************
117*** 328,334 ****
118--- 330,342 ----
119 {"PySys_SetArgv", (PYTHON_PROC*)&py3_PySys_SetArgv},
120 {"Py_SetPythonHome", (PYTHON_PROC*)&py3_Py_SetPythonHome},
121 {"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize},
122+ #ifndef PY_SSIZE_T_CLEAN
123 {"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
124+ {"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue},
125+ #else
126+ {"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
127+ {"_Py_BuildValue_SizeT", (PYTHON_PROC*)&py3_Py_BuildValue},
128+ #endif
129 {"PyMem_Free", (PYTHON_PROC*)&py3_PyMem_Free},
130 {"PyMem_Malloc", (PYTHON_PROC*)&py3_PyMem_Malloc},
131 {"PyList_New", (PYTHON_PROC*)&py3_PyList_New},
132***************
133*** 364,370 ****
134 {"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter},
135 {"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong},
136 {"PyDict_New", (PYTHON_PROC*)&py3_PyDict_New},
137- {"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue},
138 {"PyType_Ready", (PYTHON_PROC*)&py3_PyType_Ready},
139 {"PyDict_SetItemString", (PYTHON_PROC*)&py3_PyDict_SetItemString},
140 {"PyLong_AsLong", (PYTHON_PROC*)&py3_PyLong_AsLong},
141--- 372,377 ----
142*** ../vim-7.3.660/src/version.c 2012-09-12 18:19:39.000000000 +0200
143--- src/version.c 2012-09-12 19:53:52.000000000 +0200
144***************
145*** 721,722 ****
146--- 721,724 ----
147 { /* Add new patch number below this line */
148+ /**/
149+ 661,
150 /**/
151
152--
153Courtroom Quote #19:
154Q: Doctor, how many autopsies have you performed on dead people?
155A: All my autopsies have been performed on dead people.
156
157 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
158/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
159\\\ an exciting new programming language -- http://www.Zimbu.org ///
160 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
This page took 0.40396 seconds and 4 git commands to generate.