diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-07-02 21:51:32 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-07-02 21:51:32 +0200 |
commit | da127cbb3eb5674b09fa195d09b047f0b2914b7f (patch) | |
tree | b170bdac092c91c3c7116765dad0694d6a0a9754 /src | |
parent | 8264e09ca2f3bd93eba5eefa342267f303085629 (diff) |
fix against corrupted output in parallel logging
In 825607672215b7a12ea6e201a89cd5209f6d657f it was attempted to fix
a bug previously introduced by logging related changes. The problem
is that a va_list can be corrupted after it has been used once, so
we need to va_copy before each successive use.
And if we copy it, we also need to use the copy, and not the original ;)
Diffstat (limited to 'src')
-rw-r--r-- | src/logging.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/logging.c b/src/logging.c index 730fc37c..948b2a69 100644 --- a/src/logging.c +++ b/src/logging.c @@ -261,7 +261,7 @@ static void _logp(int subsys, int level, char *file, int line, * in undefined state. Since _output uses vsnprintf and it may * be called several times, we have to pass a copy of ap. */ va_copy(bp, ap); - _output(tar, subsys, level, file, line, cont, format, ap); + _output(tar, subsys, level, file, line, cont, format, bp); va_end(bp); } } |