Skip to content

Commit

Permalink
Fixes va_list in strbuf being left uninitialized (causes MSVC to crash)
Browse files Browse the repository at this point in the history
  • Loading branch information
petsbest1j authored and Naios committed Sep 17, 2023
1 parent 79ebe08 commit 8ab54f5
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 8ab54f5

Please sign in to comment.