home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.1064 < prev    next >
Encoding:
Internet Message Format  |  2013-05-29  |  4.5 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1064
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.1064
  11. Problem:    Python: insufficient error checking.
  12. Solution:   Python patch 23. (ZyX)
  13. Files:      src/if_py_both.h
  14.  
  15.  
  16. *** ../vim-7.3.1063/src/if_py_both.h    2013-05-30 13:14:06.000000000 +0200
  17. --- src/if_py_both.h    2013-05-30 13:16:23.000000000 +0200
  18. ***************
  19. *** 3304,3313 ****
  20.   
  21.       for (i = 0; i < new_len; ++i)
  22.       {
  23. !         PyObject *line = PyList_GetItem(list, i);
  24.   
  25. !         array[i] = StringToLine(line);
  26. !         if (array[i] == NULL)
  27.           {
  28.           while (i)
  29.               vim_free(array[--i]);
  30. --- 3304,3313 ----
  31.   
  32.       for (i = 0; i < new_len; ++i)
  33.       {
  34. !         PyObject *line;
  35.   
  36. !         if (!(line = PyList_GetItem(list, i)) ||
  37. !         !(array[i] = StringToLine(line)))
  38.           {
  39.           while (i)
  40.               vim_free(array[--i]);
  41. ***************
  42. *** 3319,3325 ****
  43.       VimTryStart();
  44.       PyErr_Clear();
  45.   
  46. !     // START of region without "return".  Must call restore_buffer()!
  47.       switch_buffer(&savebuf, buf);
  48.   
  49.       if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
  50. --- 3319,3325 ----
  51.       VimTryStart();
  52.       PyErr_Clear();
  53.   
  54. !     /* START of region without "return".  Must call restore_buffer()! */
  55.       switch_buffer(&savebuf, buf);
  56.   
  57.       if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
  58. ***************
  59. *** 3400,3406 ****
  60.       if (buf == savebuf)
  61.           py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)extra);
  62.   
  63. !     // END of region without "return".
  64.       restore_buffer(savebuf);
  65.   
  66.       if (VimTryEnd())
  67. --- 3400,3406 ----
  68.       if (buf == savebuf)
  69.           py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)extra);
  70.   
  71. !     /* END of region without "return". */
  72.       restore_buffer(savebuf);
  73.   
  74.       if (VimTryEnd())
  75. ***************
  76. *** 3479,3488 ****
  77.   
  78.       for (i = 0; i < size; ++i)
  79.       {
  80. !         PyObject *line = PyList_GetItem(lines, i);
  81. !         array[i] = StringToLine(line);
  82.   
  83. !         if (array[i] == NULL)
  84.           {
  85.           while (i)
  86.               vim_free(array[--i]);
  87. --- 3479,3488 ----
  88.   
  89.       for (i = 0; i < size; ++i)
  90.       {
  91. !         PyObject *line;
  92.   
  93. !         if (!(line = PyList_GetItem(lines, i)) ||
  94. !         !(array[i] = StringToLine(line)))
  95.           {
  96.           while (i)
  97.               vim_free(array[--i]);
  98. ***************
  99. *** 4014,4021 ****
  100.   
  101.       if (!PyArg_ParseTuple(args, "s", &pmark))
  102.       return NULL;
  103. -     mark = *pmark;
  104.   
  105.       VimTryStart();
  106.       switch_buffer(&savebuf, self->buf);
  107.       posp = getmark(mark, FALSE);
  108. --- 4014,4028 ----
  109.   
  110.       if (!PyArg_ParseTuple(args, "s", &pmark))
  111.       return NULL;
  112.   
  113. +     if (STRLEN(pmark) != 1)
  114. +     {
  115. +     PyErr_SetString(PyExc_ValueError,
  116. +         _("mark name must be a single character"));
  117. +     return NULL;
  118. +     }
  119. +     mark = *pmark;
  120.       VimTryStart();
  121.       switch_buffer(&savebuf, self->buf);
  122.       posp = getmark(mark, FALSE);
  123. ***************
  124. *** 4258,4264 ****
  125.   
  126.       if (value->ob_type != &BufferType)
  127.       {
  128. !         PyErr_SetString(PyExc_TypeError, _("expected vim.buffer object"));
  129.           return -1;
  130.       }
  131.   
  132. --- 4265,4271 ----
  133.   
  134.       if (value->ob_type != &BufferType)
  135.       {
  136. !         PyErr_SetString(PyExc_TypeError, _("expected vim.Buffer object"));
  137.           return -1;
  138.       }
  139.   
  140. ***************
  141. *** 4283,4289 ****
  142.   
  143.       if (value->ob_type != &WindowType)
  144.       {
  145. !         PyErr_SetString(PyExc_TypeError, _("expected vim.window object"));
  146.           return -1;
  147.       }
  148.   
  149. --- 4290,4296 ----
  150.   
  151.       if (value->ob_type != &WindowType)
  152.       {
  153. !         PyErr_SetString(PyExc_TypeError, _("expected vim.Window object"));
  154.           return -1;
  155.       }
  156.   
  157. ***************
  158. *** 4315,4321 ****
  159.       {
  160.       if (value->ob_type != &TabPageType)
  161.       {
  162. !         PyErr_SetString(PyExc_TypeError, _("expected vim.tabpage object"));
  163.           return -1;
  164.       }
  165.   
  166. --- 4322,4328 ----
  167.       {
  168.       if (value->ob_type != &TabPageType)
  169.       {
  170. !         PyErr_SetString(PyExc_TypeError, _("expected vim.TabPage object"));
  171.           return -1;
  172.       }
  173.   
  174. *** ../vim-7.3.1063/src/version.c    2013-05-30 13:14:06.000000000 +0200
  175. --- src/version.c    2013-05-30 13:15:32.000000000 +0200
  176. ***************
  177. *** 730,731 ****
  178. --- 730,733 ----
  179.   {   /* Add new patch number below this line */
  180. + /**/
  181. +     1064,
  182.   /**/
  183.  
  184. -- 
  185. How To Keep A Healthy Level Of Insanity:
  186. 7. Finish all your sentences with "in accordance with the prophecy".
  187.  
  188.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  189. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  190. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  191.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  192.