patch 9.0.0949: crash when unletting a variable while listing variables
Problem: Crash when unletting a variable while listing variables.
Solution: Disallow changing a hashtable while going over the entries.
(closes #11435)
diff --git a/src/terminal.c b/src/terminal.c
index bc36317..d300c59 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1020,7 +1020,7 @@
char *hash_key = alloc(NUMBUFLEN);
vim_snprintf(hash_key, NUMBUFLEN, "%d", bufnr);
- hash_add(terminal_bufs, (char_u *)hash_key);
+ hash_add(terminal_bufs, (char_u *)hash_key, "terminal session");
}
return put_eol(fd);