Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes va_list in strbuf being left uninitialized (causes MSVC to crash) #98

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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