Fix format string bugs with sizeof(int)!=sizeof(size_t) in mod_accesslog for SYSLOG

(assuming there are no access-log-lines > 2GB)


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2285 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.20
Stefan Bühler 2008-08-19 16:41:36 +00:00
parent 24804542d2
commit 227d6f1b56
2 changed files with 4 additions and 3 deletions

1
NEWS
View File

@ -53,6 +53,7 @@ NEWS
* fixed conditional patching of ldap filter (#1564)
* Match headers case insensitive in response (removing of X-{Sendfile,LIGHTTPD-*}, catching Date/Server)
* fixed bug with case-insensitive filenames in mod_userdir (#1589), spotted by "anders1"
* fixed format string bugs in mod_accesslog for SYSLOG
- 1.4.19 - 2008-03-10

View File

@ -356,7 +356,7 @@ FREE_FUNC(mod_accesslog_free) {
if (s->use_syslog) {
# ifdef HAVE_SYSLOG_H
if (s->access_logbuffer->used > 2) {
syslog(LOG_INFO, "%*s", s->access_logbuffer->used - 2, s->access_logbuffer->ptr);
syslog(LOG_INFO, "%*s", (int) s->access_logbuffer->used - 2, s->access_logbuffer->ptr);
}
# endif
} else if (s->log_access_fd != -1) {
@ -561,7 +561,7 @@ SIGHUP_FUNC(log_access_cycle) {
#ifdef HAVE_SYSLOG_H
if (s->access_logbuffer->used > 2) {
/* syslog appends a \n on its own */
syslog(LOG_INFO, "%*s", s->access_logbuffer->used - 2, s->access_logbuffer->ptr);
syslog(LOG_INFO, "%*s", (int) s->access_logbuffer->used - 2, s->access_logbuffer->ptr);
}
#endif
} else if (s->log_access_fd != -1) {
@ -859,7 +859,7 @@ REQUESTDONE_FUNC(log_access_write) {
#ifdef HAVE_SYSLOG_H
if (b->used > 2) {
/* syslog appends a \n on its own */
syslog(LOG_INFO, "%*s", b->used - 2, b->ptr);
syslog(LOG_INFO, "%*s", (int) b->used - 2, b->ptr);
}
#endif
} else if (p->conf.log_access_fd != -1) {