diff src/if_py_both.h @ 5426:9cedb4dfd4c8 v7.4.063

updated for version 7.4.063 Problem: Crash when using invalid key in Python dictionary. Solution: Check for object to be NULL. Add tests. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Mon, 04 Nov 2013 00:34:53 +0100
parents 6fa64615c8d3
children a56f60cf6834
line wrap: on
line diff
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -1624,6 +1624,9 @@ DictionaryContains(DictionaryObject *sel
     PyObject	*rObj = _DictionaryItem(self, keyObject, DICT_FLAG_RETURN_BOOL);
     int		ret;
 
+    if (rObj == NULL)
+	return -1;
+
     ret = (rObj == Py_True);
 
     Py_DECREF(rObj);