updated for version 7.3.683
Problem: ":python" may crash when vimbindeval() returns None.
Solution: Check for v_string to be NULL. (Yukihiro Nakadaira)
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 0a1ef1b..2398e81 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -351,7 +351,8 @@
if (our_tv->v_type == VAR_STRING)
{
- result = Py_BuildValue("s", our_tv->vval.v_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,7 +2752,8 @@
switch (tv->v_type)
{
case VAR_STRING:
- return PyBytes_FromString((char *) tv->vval.v_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,7 +2765,8 @@
case VAR_DICT:
return DictionaryNew(tv->vval.v_dict);
case VAR_FUNC:
- return FunctionNew(tv->vval.v_string);
+ return FunctionNew(tv->vval.v_string == NULL
+ ? (char_u *)"" : tv->vval.v_string);
case VAR_UNKNOWN:
Py_INCREF(Py_None);
return Py_None;
diff --git a/src/version.c b/src/version.c
index 143657e..62e0f4b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -720,6 +720,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 683,
+/**/
682,
/**/
681,