summaryrefslogtreecommitdiff
path: root/Zend/zend_hash.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-04-10 12:18:57 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-04-10 12:18:57 +0200
commitc7a86a38a3f657ab81163ac794450fc7ada2ba3c (patch)
tree9c09ee675977102b894cea4d0465dc2e5a611d27 /Zend/zend_hash.c
parentb55715d61a908f7732d5a2bb6b20a105f372014a (diff)
downloadphp-git-c7a86a38a3f657ab81163ac794450fc7ada2ba3c.tar.gz
Fix pgsql use after free trying to reuse closed connection
When a connection is closed, we also need to remove the hash entry from the regular_list, as it now points to freed memory. To do this store a reverse mapping from the connection to the hash string. It would be nicer to introduce a wrapping structure for the pgsql link resource that could store the hash (and notices), but that would require large changes to the extension, so I'm going for a more minimal fix here.
Diffstat (limited to 'Zend/zend_hash.c')
-rw-r--r--Zend/zend_hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 80938694e5..f5fba67982 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -61,7 +61,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin
zend_output_debug_string(1, "%s(%d) : ht=%p is inconsistent", file, line, ht);
break;
}
- zend_bailout();
+ ZEND_ASSERT(0);
}
#define IS_CONSISTENT(a) _zend_is_inconsistent(a, __FILE__, __LINE__);
#define SET_INCONSISTENT(n) do { \