diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-11-04 00:34:53 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-11-04 00:34:53 +0100 |
commit | ba2d7ffc4bd69175ddeffb77a7b459787baa0d92 (patch) | |
tree | 938ed24d19490797dad752ba16a8893cbde3ea80 /src/if_py_both.h | |
parent | d5d015d4570eabc9a2da620cce906617e72ac625 (diff) |
updated for version 7.4.063v7.4.063
Problem: Crash when using invalid key in Python dictionary.
Solution: Check for object to be NULL. Add tests. (ZyX)
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r-- | src/if_py_both.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index 6ea0afff62..748577981c 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -1624,6 +1624,9 @@ DictionaryContains(DictionaryObject *self, PyObject *keyObject) PyObject *rObj = _DictionaryItem(self, keyObject, DICT_FLAG_RETURN_BOOL); int ret; + if (rObj == NULL) + return -1; + ret = (rObj == Py_True); Py_DECREF(rObj); |