| To: vim_dev@googlegroups.com |
| Subject: Patch 7.3.683 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.3.683 |
| Problem: ":python" may crash when vimbindeval() returns None. |
| Solution: Check for v_string to be NULL. (Yukihiro Nakadaira) |
| Files: src/if_py_both.h |
| |
| |
| |
| |
| |
| *** 351,357 **** |
| |
| if (our_tv->v_type == VAR_STRING) |
| { |
| ! result = Py_BuildValue("s", our_tv->vval.v_string); |
| } |
| else if (our_tv->v_type == VAR_NUMBER) |
| { |
| --- 351,358 ---- |
| |
| if (our_tv->v_type == VAR_STRING) |
| { |
| ! result = Py_BuildValue("s", our_tv->vval.v_string == NULL |
| ! ? "" : (char *)our_tv->vval.v_string); |
| } |
| else if (our_tv->v_type == VAR_NUMBER) |
| { |
| |
| *** 2751,2757 **** |
| switch (tv->v_type) |
| { |
| case VAR_STRING: |
| ! return PyBytes_FromString((char *) tv->vval.v_string); |
| case VAR_NUMBER: |
| return PyLong_FromLong((long) tv->vval.v_number); |
| #ifdef FEAT_FLOAT |
| --- 2752,2759 ---- |
| switch (tv->v_type) |
| { |
| case VAR_STRING: |
| ! return PyBytes_FromString(tv->vval.v_string == NULL |
| ! ? "" : (char *)tv->vval.v_string); |
| case VAR_NUMBER: |
| return PyLong_FromLong((long) tv->vval.v_number); |
| #ifdef FEAT_FLOAT |
| |
| *** 2763,2769 **** |
| case VAR_DICT: |
| return DictionaryNew(tv->vval.v_dict); |
| case VAR_FUNC: |
| ! return FunctionNew(tv->vval.v_string); |
| case VAR_UNKNOWN: |
| Py_INCREF(Py_None); |
| return Py_None; |
| --- 2765,2772 ---- |
| case VAR_DICT: |
| return DictionaryNew(tv->vval.v_dict); |
| case VAR_FUNC: |
| ! return FunctionNew(tv->vval.v_string == NULL |
| ! ? (char_u *)"" : tv->vval.v_string); |
| case VAR_UNKNOWN: |
| Py_INCREF(Py_None); |
| return Py_None; |
| |
| |
| |
| *** 721,722 **** |
| --- 721,724 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 683, |
| /**/ |
| |
| -- |
| SIGIRO -- irony detected (iron core dumped) |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |