diff src/if_py_both.h @ 4317:4281875776fb v7.3.908

updated for version 7.3.908 Problem: Possible crash when using a list in Python. Solution: Return early if the list is NULL. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Wed, 24 Apr 2013 13:10:41 +0200
parents 9f3da1dea7c0
children b79f3c3a584c
line wrap: on
line diff
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -738,6 +738,8 @@ pymap_to_tv(PyObject *obj, typval_T *tv,
     tv->vval.v_dict = d;
 
     list = PyMapping_Items(obj);
+    if (list == NULL)
+	return -1;
     lsize = PyList_Size(list);
     while (lsize--)
     {