Skip to content

Commit 1aec3e0

Browse files
committed
updated for version 7.4.625
Problem: Possible NULL pointer dereference. Solution: Check for NULL before using it. (Mike Williams)
1 parent 3a336c4 commit 1aec3e0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/if_py_both.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,12 +747,14 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
747747
else if (our_tv->v_type == VAR_DICT)
748748
{
749749

750-
hashtab_T *ht = &our_tv->vval.v_dict->dv_hashtab;
751-
long_u todo = ht->ht_used;
750+
hashtab_T *ht;
751+
long_u todo;
752752
hashitem_T *hi;
753753
dictitem_T *di;
754+
754755
if (our_tv->vval.v_dict == NULL)
755756
return NULL;
757+
ht = &our_tv->vval.v_dict->dv_hashtab;
756758

757759
if (!(ret = PyDict_New()))
758760
return NULL;
@@ -763,6 +765,7 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
763765
return NULL;
764766
}
765767

768+
todo = ht->ht_used;
766769
for (hi = ht->ht_array; todo > 0; ++hi)
767770
{
768771
if (!HASHITEM_EMPTY(hi))

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
625,
744746
/**/
745747
624,
746748
/**/

0 commit comments

Comments
 (0)