diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-07-18 23:35:59 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-07-20 18:00:42 +0200 |
commit | dee629c92d4159556f382ffe42d74179a01b7f26 (patch) | |
tree | 6b974113f766c7120872c13331553ec19691f299 /sapi/phpdbg/phpdbg_bp.c | |
parent | 699e641e93e2a697e8418b4f59d84227324631d2 (diff) | |
download | php-git-dee629c92d4159556f382ffe42d74179a01b7f26.tar.gz |
Fix use of already freed hashtable (wrong variable)
Diffstat (limited to 'sapi/phpdbg/phpdbg_bp.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_bp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index 1c06646f0e..48239ccac8 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -285,7 +285,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, long line_num) /* { phpdbg_debug("Compare against loaded %s\n", file); if (!(pending = ((fileht = phpdbg_resolve_pending_file_break_ex(ZSTR_VAL(file), ZSTR_LEN(file), path_str, broken)) == NULL))) { - new_break = *(phpdbg_breakfile_t *) zend_hash_index_find_ptr(broken, line_num); + new_break = *(phpdbg_breakfile_t *) zend_hash_index_find_ptr(fileht, line_num); break; } } ZEND_HASH_FOREACH_END(); @@ -327,8 +327,7 @@ PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uin new_brake.filename = estrndup(file, filelen); PHPDBG_BREAK_UNMAPPING(brake->id); - if (master) { - zend_hash_index_update_mem(master, brake->line, &new_brake, sizeof(phpdbg_breakfile_t)); + if (zend_hash_index_add_mem(master, brake->line, &new_brake, sizeof(phpdbg_breakfile_t))) { PHPDBG_BREAK_MAPPING(brake->id, master); } } ZEND_HASH_FOREACH_END(); |