summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2009-10-16 18:54:02 +0000
committerstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2009-10-16 18:54:02 +0000
commit4ca0d9c0fbe4c5ab2634f7e990ee6270c085b834 (patch)
treecf3d327310fb5147a58f15302d8b4143c54398c3
parentd9b134f6d1f967e70cfc99827d20defc6cc7876c (diff)
downloadlighttpd-4ca0d9c0fbe4c5ab2634f7e990ee6270c085b834.tar.gz
Fix accesslog escape segfault (#1551)
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@2662 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--src/mod_accesslog.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mod_accesslog.c b/src/mod_accesslog.c
index 276981cb..e26bee89 100644
--- a/src/mod_accesslog.c
+++ b/src/mod_accesslog.c
@@ -166,6 +166,7 @@ INIT_FUNC(mod_accesslog_init) {
static void accesslog_append_escaped(buffer *dest, buffer *str) {
/* replaces non-printable chars with \xHH where HH is the hex representation of the byte */
/* exceptions: " => \", \ => \\, whitespace chars => \n \t etc. */
+ if (str->used == 0) return;
buffer_prepare_append(dest, str->used - 1);
for (unsigned int i = 0; i < str->used - 1; i++) {