Skip to content

Commit fa65f5e

Browse files
committed
Fix #78212: Segfault in built-in webserver
Since syslog's ident and facility parameters have been added to config[1], vsyslog() segfaults on Windows, if openlog() has not been called before. We bring back the removed lines to fix this. [1] <http://git.php.net/?p=php-src.git;a=commit;h=2475337bd8a0fad0dac03db3f5e7e9d331d53653>
1 parent e7a83ec commit fa65f5e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PHP NEWS
44

55
- Core:
66
. Added syslog.filter=raw option. (Erik Lundin)
7+
. Fixed bug #78212 (Segfault in built-in webserver). (cmb)
78

89
- Date:
910
. Fixed #69044 (discrepency between time and microtime). (krakjoe)

win32/wsyslog.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ void vsyslog(int priority, const char *message, va_list args)
9595
DWORD evid;
9696
wchar_t *strsw[2];
9797

98+
/* default event source */
99+
if (INVALID_HANDLE_VALUE == PW32G(log_source))
100+
openlog("php", LOG_PID, LOG_SYSLOG);
101+
98102
switch (priority) { /* translate UNIX type into NT type */
99103
case LOG_ALERT:
100104
etype = EVENTLOG_ERROR_TYPE;

0 commit comments

Comments
 (0)