Browse Source

fixed NULL dereference in logfile cycling if accesslog is not set

git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@98 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/release-1.3.13
Jan Kneschke 17 years ago
parent
commit
e1fb43d9dd
  1. 6
      src/mod_accesslog.c

6
src/mod_accesslog.c

@ -532,7 +532,7 @@ SIGHUP_FUNC(log_access_cycle) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
if(s->access_logbuffer->used) {
if (s->access_logbuffer->used) {
if (s->use_syslog) {
#ifdef HAVE_SYSLOG_H
syslog(LOG_INFO, "%*s", s->access_logbuffer->used - 1, s->access_logbuffer->ptr);
@ -540,10 +540,12 @@ SIGHUP_FUNC(log_access_cycle) {
} else if (s->log_access_fd != -1) {
write(s->log_access_fd, s->access_logbuffer->ptr, s->access_logbuffer->used - 1);
}
s->access_logbuffer->used = 0;
buffer_reset(s->access_logbuffer);
}
if (s->use_syslog == 0 &&
!buffer_is_empty(s->access_logfile) &&
s->access_logfile->ptr[0] != '|') {
close(s->log_access_fd);

Loading…
Cancel
Save