Skip to content

Commit

Permalink
Fix undersized string buffer for library link command in Windows.
Browse files Browse the repository at this point in the history
The compiler was not allocating a big enough buffer for the linker command line on Windows.  This change makes it allocate more than enough space.

Fixes ponylang#2222.
  • Loading branch information
chalcolith committed Sep 7, 2017
1 parent a58a532 commit 77b264c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libponyc/codegen/genlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static bool link_lib(compile_t* c, const char* file_o)
return false;
}

size_t len = 128 + strlen(file_lib) + strlen(file_o);
size_t len = strlen(vcvars.ar) + strlen(file_lib) + strlen(file_o) + 64;
char* cmd = (char*)ponyint_pool_alloc_size(len);

snprintf(cmd, len, "cmd /C \"\"%s\" /NOLOGO /OUT:%s %s\"", vcvars.ar,
Expand Down

0 comments on commit 77b264c

Please sign in to comment.