Mercurial > vim
changeset 6598:4b1e3b3aa78a v7.4.625
updated for version 7.4.625
Problem: Possible NULL pointer dereference.
Solution: Check for NULL before using it. (Mike Williams)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 10 Feb 2015 18:41:58 +0100 |
parents | 6bb932add4f4 |
children | b9f2ff388516 |
files | src/if_py_both.h src/version.c |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -747,12 +747,14 @@ VimToPython(typval_T *our_tv, int depth, 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, return NULL; } + todo = ht->ht_used; for (hi = ht->ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi))