Skip to content

Commit bd72352

Browse files
committed
Avoid using MCNameGetCString() in Windows deployment
1 parent 3f61237 commit bd72352

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

engine/src/deploy_windows.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,13 @@ static bool add_version_info_entry(void *p_context, MCArrayRef p_array, MCNameRe
11161116
!t_bytes . Push('\0'))
11171117
return false;
11181118
}
1119-
1119+
1120+
MCAutoStringRefAsCString t_key_str;
1121+
if (!t_key_str.Lock(MCNameGetString(p_key)))
1122+
return false;
1123+
11201124
MCWindowsVersionInfo *t_string;
1121-
return MCWindowsVersionInfoAdd((MCWindowsVersionInfo *)p_context, MCNameGetCString(p_key), true, t_bytes . Ptr(), t_bytes . Size(), t_string);
1125+
return MCWindowsVersionInfoAdd((MCWindowsVersionInfo *)p_context, *t_key_str, true, t_bytes . Ptr(), t_bytes . Size(), t_string);
11221126
}
11231127

11241128
static bool MCWindowsResourcesAddVersionInfo(MCWindowsResources& self, MCArrayRef p_info)

0 commit comments

Comments
 (0)