summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-11-22 13:33:53 +0000
committerDmitry Stogov <dmitry@php.net>2007-11-22 13:33:53 +0000
commit47dc82ecb99f45b6757fd2de5559fcc94e1da49f (patch)
tree326b3712d240065268e04937ffc5654dccc3a3c2 /main
parent975a66da798dbb1c900bf05fb951610dfc0d8579 (diff)
downloadphp-git-47dc82ecb99f45b6757fd2de5559fcc94e1da49f.tar.gz
Fixed bug #43128 (Very long class name causes segfault)
Diffstat (limited to 'main')
-rw-r--r--main/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/main/main.c b/main/main.c
index 998e351eeb..c6816b8b94 100644
--- a/main/main.c
+++ b/main/main.c
@@ -2090,6 +2090,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
int old_cwd_fd = -1;
#else
char *old_cwd;
+ ALLOCA_FLAG(use_heap)
#endif
int retval = 0;
@@ -2100,7 +2101,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
}
#ifndef HAVE_BROKEN_GETCWD
# define OLD_CWD_SIZE 4096
- old_cwd = do_alloca(OLD_CWD_SIZE);
+ old_cwd = do_alloca(OLD_CWD_SIZE, use_heap);
old_cwd[0] = '\0';
#endif
@@ -2177,7 +2178,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
if (old_cwd[0] != '\0') {
VCWD_CHDIR(old_cwd);
}
- free_alloca(old_cwd);
+ free_alloca(old_cwd, use_heap);
#endif
return retval;
}
@@ -2188,10 +2189,11 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret TSRMLS_DC)
{
char *old_cwd;
+ ALLOCA_FLAG(use_heap)
EG(exit_status) = 0;
#define OLD_CWD_SIZE 4096
- old_cwd = do_alloca(OLD_CWD_SIZE);
+ old_cwd = do_alloca(OLD_CWD_SIZE, use_heap);
old_cwd[0] = '\0';
zend_try {
@@ -2212,7 +2214,7 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret
VCWD_CHDIR(old_cwd);
}
- free_alloca(old_cwd);
+ free_alloca(old_cwd, use_heap);
return EG(exit_status);
}
/* }}} */