Skip to content

Commit bc1647a

Browse files
authored
Use vsnprintf instead of vsprintf in Portability.h (#39366)
1 parent 758d99b commit bc1647a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/swift/Runtime/Portability.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ swift_vasprintf(char **strp, const char *fmt, va_list args) {
4646
char *buffer = reinterpret_cast<char *>(malloc(len + 1));
4747
if (!buffer)
4848
return -1;
49-
int result = vsprintf(buffer, fmt, args);
49+
int result = vsnprintf(buffer, len + 1, fmt, args);
5050
if (result < 0) {
5151
free(buffer);
5252
return -1;

0 commit comments

Comments
 (0)