diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-05-15 16:11:50 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-05-15 16:11:50 +0200 |
commit | b983f75d228accb62fb07eff94c16a3a76f59498 (patch) | |
tree | 0531b01894079bdf3b4074f1408b2ad5d62c952d | |
parent | d5f729cada4129ceb8296b86390c38021684c75f (diff) | |
download | vim-git-b983f75d228accb62fb07eff94c16a3a76f59498.tar.gz |
updated for version 7.3.954v7.3.954
Problem: No check if PyObject_IsTrue fails.
Solution: Add a check for -1 value. (ZyX)
-rw-r--r-- | src/if_py_both.h | 15 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index 9e6c6752b..4905bed68 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -700,7 +700,10 @@ DictionarySetattr(PyObject *self, char *name, PyObject *val) } else { - if (PyObject_IsTrue(val)) + int istrue = PyObject_IsTrue(val); + if (istrue == -1) + return -1; + else if (istrue) this->dict->dv_lock = VAR_LOCKED; else this->dict->dv_lock = 0; @@ -1201,7 +1204,10 @@ ListSetattr(PyObject *self, char *name, PyObject *val) } else { - if (PyObject_IsTrue(val)) + int istrue = PyObject_IsTrue(val); + if (istrue == -1) + return -1; + else if (istrue) this->list->lv_lock = VAR_LOCKED; else this->list->lv_lock = 0; @@ -1479,7 +1485,10 @@ OptionsAssItem(OptionsObject *this, PyObject *keyObject, PyObject *valObject) if (flags & SOPT_BOOL) { - r = set_option_value_for(key, PyObject_IsTrue(valObject), NULL, + int istrue = PyObject_IsTrue(valObject); + if (istrue == -1) + return -1; + r = set_option_value_for(key, istrue, NULL, opt_flags, this->opt_type, this->from); } else if (flags & SOPT_NUM) diff --git a/src/version.c b/src/version.c index 5e472cb7c..6d3e7850f 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 954, +/**/ 953, /**/ 952, |