diff options
-rw-r--r-- | openbsc/src/debug.c | 11 |
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); + } } } |