summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2009-10-16 18:56:04 +0000
committerStefan Bühler <stbuehler@web.de>2009-10-16 18:56:04 +0000
commit6ecb86159c63796a9263b2c7bb336dd03198d0b6 (patch)
treeed9fa08f85a69d1d4fe9640748bd8b1acf7cbc12
parent069e848a0c1fc11cb3e4da8c7c12120cdd6699ef (diff)
downloadlighttpd-git-6ecb86159c63796a9263b2c7bb336dd03198d0b6.tar.gz
Fix accesslog escape segfault (#1551)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2664 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--src/mod_accesslog.c1
-rwxr-xr-xtests/LightyTest.pm2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/mod_accesslog.c b/src/mod_accesslog.c
index 9715596c..b6e38140 100644
--- a/src/mod_accesslog.c
+++ b/src/mod_accesslog.c
@@ -159,6 +159,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++) {
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm
index 15bf583d..19f01626 100755
--- a/tests/LightyTest.pm
+++ b/tests/LightyTest.pm
@@ -124,7 +124,7 @@ sub start_proc {
} elsif (defined $ENV{"TRACEME"} && $ENV{"TRACEME"} eq 'truss') {
$cmdline = "truss -a -l -w all -v all -o strace ".$cmdline;
} elsif (defined $ENV{"TRACEME"} && $ENV{"TRACEME"} eq 'gdb') {
- $cmdline = "gdb --batch --ex 'run' --ex 'bt' --args ".$cmdline." > gdb.out";
+ $cmdline = "gdb --batch --ex 'run' --ex 'bt full' --args ".$cmdline." > gdb.out";
} elsif (defined $ENV{"TRACEME"} && $ENV{"TRACEME"} eq 'valgrind') {
$cmdline = "valgrind --tool=memcheck --show-reachable=yes --leak-check=yes --log-file=valgrind ".$cmdline;
}