Skip to content

Commit aa11b94

Browse files
committed
Merge branch 'jk/bug-fl-va-list-fix'
Fix buggy va_list usage in recent code. * jk/bug-fl-va-list-fix: bug_fl(): correctly initialize trace2 va_list
2 parents 7f5a382 + f853559 commit aa11b94

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

t/helper/test-trace2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ static int ut_009bug_BUG(int argc, const char **argv)
224224

225225
static int ut_010bug_BUG(int argc, const char **argv)
226226
{
227-
bug("a bug message");
228-
BUG("a BUG message");
227+
bug("a %s message", "bug");
228+
BUG("a %s message", "BUG");
229229
}
230230

231231
/*

usage.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,15 +334,17 @@ NORETURN void BUG_fl(const char *file, int line, const char *fmt, ...)
334334
int bug_called_must_BUG;
335335
void bug_fl(const char *file, int line, const char *fmt, ...)
336336
{
337-
va_list ap, cp;
337+
va_list ap;
338338

339339
bug_called_must_BUG = 1;
340340

341-
va_copy(cp, ap);
342341
va_start(ap, fmt);
343342
BUG_vfl_common(file, line, fmt, ap);
344343
va_end(ap);
345-
trace2_cmd_error_va(fmt, cp);
344+
345+
va_start(ap, fmt);
346+
trace2_cmd_error_va(fmt, ap);
347+
va_end(ap);
346348
}
347349

348350
#ifdef SUPPRESS_ANNOTATED_LEAKS

0 commit comments

Comments
 (0)