Skip to content

Commit 14f5732

Browse files
committed
Fix bug #65470 Segmentation fault in zend_error() with --enable-dtrace
1 parent 9973658 commit 14f5732

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ PHP NEWS
33
?? ??? 2013, PHP 5.4.19
44

55
- Core:
6+
. Fixed bug #65470 (Segmentation fault in zend_error() with
7+
--enable-dtrace). (Chris Jones)
68
. Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference
79
fails). (Laruence)
810
. Fixed bug #65304 (Use of max int in array_sum). (Laruence)

Zend/zend.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,17 +1091,19 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
10911091
error_filename = "Unknown";
10921092
}
10931093

1094-
va_start(args, format);
1095-
10961094
#ifdef HAVE_DTRACE
10971095
if(DTRACE_ERROR_ENABLED()) {
10981096
char *dtrace_error_buffer;
1097+
va_start(args, format);
10991098
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
11001099
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
11011100
efree(dtrace_error_buffer);
1101+
va_end(args);
11021102
}
11031103
#endif /* HAVE_DTRACE */
11041104

1105+
va_start(args, format);
1106+
11051107
/* if we don't have a user defined error handler */
11061108
if (!EG(user_error_handler)
11071109
|| !(EG(user_error_handler_error_reporting) & type)

0 commit comments

Comments
 (0)