if (PHPDBG_G(exec)) {
efree(PHPDBG_G(exec));
}
- PHPDBG_G(exec) = estrdup("-");
- PHPDBG_G(exec_len) = 1;
+ PHPDBG_G(exec) = estrdup("Standard input code");
+ PHPDBG_G(exec_len) = sizeof("Standard input code") - 1;
{ /* remove leading ?> from source */
int i;
- zend_string *source_path = strpprintf(0, "-%c%p", 0, PHPDBG_G(ops)->opcodes);
+ /* remove trailing data after zero byte, used for avoiding conflicts in eval()'ed code snippets */
+ zend_string *source_path = strpprintf(0, "Standard input code%c%p", 0, PHPDBG_G(ops)->opcodes);
phpdbg_file_source *data = zend_hash_find_ptr(&PHPDBG_G(file_sources), source_path);
dtor_func_t dtor = PHPDBG_G(file_sources).pDestructor;
PHPDBG_G(file_sources).pDestructor = NULL;
zend_hash_del(&PHPDBG_G(file_sources), source_path);
PHPDBG_G(file_sources).pDestructor = dtor;
- zend_hash_str_update_ptr(&PHPDBG_G(file_sources), "-", 1, data);
+ zend_hash_str_update_ptr(&PHPDBG_G(file_sources), "Standard input code", sizeof("Standard input code")-1, data);
zend_string_release(source_path);
- efree(data->filename);
- data->filename = estrdup("Standard input code");
-
for (i = 1; i <= data->lines; i++) {
data->line[i] -= 2;
}