From 81b7ecc5cb78cad901a9a85e46ecba109cc6ee7d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 26 Dec 2022 13:08:06 +0000 Subject: [PATCH] patch 9.0.1099: trying to resize a hashtab may cause a problem Problem: Trying to resize a hashtab may cause a problem. Solution: Do not try to resize a hashtab before adding an item. --- src/hashtab.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hashtab.c b/src/hashtab.c index dc4ef8888..8c25c818b 100644 --- a/src/hashtab.c +++ b/src/hashtab.c @@ -249,7 +249,7 @@ hash_add_item( hash_T hash) { // If resizing failed before and it fails again we can't add an item. - if ((ht->ht_flags & HTFLAGS_ERROR) && hash_may_resize(ht, 0) == FAIL) + if (ht->ht_flags & HTFLAGS_ERROR) return FAIL; ++ht->ht_used; diff --git a/src/version.c b/src/version.c index fdaffe395..eb362a3de 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1099, /**/ 1098, /**/ -- 2.40.0