Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91a3468

Browse files
committed
Fix off-by-one error.
1 parent 7dae234 commit 91a3468

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

PC/launcher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static wchar_t * get_env(wchar_t * key)
6363
static wchar_t buf[256];
6464
DWORD result = GetEnvironmentVariableW(key, buf, 256);
6565

66-
if (result > 256) {
66+
if (result > 255) {
6767
/* Large environment variable. Accept some leakage */
6868
wchar_t *buf2 = (wchar_t*)malloc(sizeof(wchar_t) * (result+1));
6969
GetEnvironmentVariableW(key, buf2, result);

0 commit comments

Comments
 (0)