summaryrefslogtreecommitdiff
path: root/src/if_py_both.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-02-10 18:41:58 +0100
committerBram Moolenaar <Bram@vim.org>2015-02-10 18:41:58 +0100
commit24a6ff88bc8710c305deba405d00061dec909125 (patch)
treef9794ab4ff4de7281d78a48c864d64893fcbe325 /src/if_py_both.h
parent9abd5c6507154eabdfe8256940a24f090db0f533 (diff)
downloadvim-24a6ff88bc8710c305deba405d00061dec909125.zip
updated for version 7.4.625
Problem: Possible NULL pointer dereference. Solution: Check for NULL before using it. (Mike Williams)
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r--src/if_py_both.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index a46b42add..497db8665 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -747,12 +747,14 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
else if (our_tv->v_type == VAR_DICT)
{
- hashtab_T *ht = &our_tv->vval.v_dict->dv_hashtab;
- long_u todo = ht->ht_used;
+ hashtab_T *ht;
+ long_u todo;
hashitem_T *hi;
dictitem_T *di;
+
if (our_tv->vval.v_dict == NULL)
return NULL;
+ ht = &our_tv->vval.v_dict->dv_hashtab;
if (!(ret = PyDict_New()))
return NULL;
@@ -763,6 +765,7 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
return NULL;
}
+ todo = ht->ht_used;
for (hi = ht->ht_array; todo > 0; ++hi)
{
if (!HASHITEM_EMPTY(hi))