Skip to content

Commit a7e00f6

Browse files
authored
fix: Off by 1 buffer overflow in commandLine allocation (#1976)
1 parent 185fec5 commit a7e00f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/xr_3da/entry_point.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ int main(int argc, char *argv[])
8888
int i;
8989
if(argc > 1)
9090
{
91-
size_t sum = 0;
91+
size_t sum = 1;
9292
for(i = 1; i < argc; ++i)
93-
sum += strlen(argv[i]) + strlen(" \0");
93+
sum += strlen(argv[i]) + 1;
9494

9595
commandLine = (char*)xr_malloc(sum);
9696
ZeroMemory(commandLine, sum);

0 commit comments

Comments
 (0)