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/if_py_both.h b/src/if_py_both.h
index 2857cc7..d6cb13b 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -1768,7 +1768,7 @@
return NULL;
}
- hash_remove(&dict->dv_hashtab, hi);
+ hash_remove(&dict->dv_hashtab, hi, "Python remove variable");
dictitem_free(di);
}
@@ -1893,7 +1893,7 @@
return -1;
}
hi = hash_find(&dict->dv_hashtab, di->di_key);
- hash_remove(&dict->dv_hashtab, hi);
+ hash_remove(&dict->dv_hashtab, hi, "Python remove item");
dictitem_free(di);
Py_XDECREF(todecref);
return 0;
@@ -2194,7 +2194,7 @@
return NULL;
}
- hash_remove(&self->dict->dv_hashtab, hi);
+ hash_remove(&self->dict->dv_hashtab, hi, "Python pop item");
dictitem_free(di);
return ret;