Skip to content

Commit

Permalink
Merge pull request #98 from Naios/va_list_uninitialized
Browse files Browse the repository at this point in the history
Fixes va_list in strbuf being left uninitialized (causes MSVC to crash)
  • Loading branch information
SanderMertens authored Sep 18, 2023
2 parents ef6c177 + d26ddde commit 1c3a6a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util/src/strbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include <bake_util.h>

#define UT_VA_INIT (va_list){0}

/* Add an extra element to the buffer */
static
void ut_strbuf_grow(
Expand Down Expand Up @@ -277,7 +279,7 @@ bool ut_strbuf_appendstrn(
const char* str,
int64_t len)
{
va_list args;
va_list args = UT_VA_INIT;
return ut_strbuf_append_intern(
b, str, len, false, args
);
Expand Down Expand Up @@ -307,7 +309,7 @@ bool ut_strbuf_appendstr(
ut_strbuf *b,
const char* str)
{
va_list args;
va_list args = UT_VA_INIT;
return ut_strbuf_append_intern(
b, str, -1, false, args
);
Expand Down

0 comments on commit 1c3a6a4

Please sign in to comment.