aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/debug.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2009-12-24 11:12:11 +0100
committerHarald Welte <laforge@netfilter.org>2009-12-24 11:12:11 +0100
commitaa8989c4d538b19fd0890a1afbdda42a5f311752 (patch)
tree808a0d2d9c7e2e06f64b5c8a8489858250818215 /openbsc/src/debug.c
parentaa6c9ca48b5dd15bab130b64136dfc8a1311fe8c (diff)
debug: workaround for strange va_list corruption bug
Diffstat (limited to 'openbsc/src/debug.c')
-rw-r--r--openbsc/src/debug.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/openbsc/src/debug.c b/openbsc/src/debug.c
index 30e27a8d5..15271fe72 100644
--- a/openbsc/src/debug.c
+++ b/openbsc/src/debug.c
@@ -223,8 +223,15 @@ static void _debugp(unsigned int subsys, int level, char *file, int line,
output = 1;
}
- if (output)
- _output(tar, subsys, file, line, cont, format, ap);
+ if (output) {
+ /* FIXME: copying the va_list is an ugly workaround against a bug
+ * hidden somewhere in _output. If we do not copy here, the first
+ * call to _output() will corrupt the va_list contents, and any
+ * further _output() calls with the same va_list will segfault */
+ va_list bp;
+ va_copy(bp, ap);
+ _output(tar, subsys, file, line, cont, format, bp);
+ }
}
}