You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting from FXServer 12767, using os.date("!%Y-%m-%dT%H:%M:%SZ", os.time()) with UTC formatting appends a null terminator (<\0>) at the end of the string.
Expected result
os.date("!%Y-%m-%dT%H:%M:%SZ", os.time()) should return a valid ISO 8601 timestamp without a null terminator (<\0>).
Reproduction steps
Run the following Lua script on FXServer 12767+:
print("ISO 8601 (UTC):", os.date("!%Y-%m-%dT%H:%M:%SZ"))
print("ISO 8601 (LOCAL):", os.date("%Y-%m-%dT%H:%M:%SZ"))
print("Standard Date:", os.date("%c"))
print("YYYY-MM-DD:", os.date("%Y-%m-%d"))
print("24-hour Time:", os.date("%H:%M:%S"))
print("12-hour Time:", os.date("%I:%M:%S %p"))
print("Day of the Week:", os.date("%A"))
print("Day of the Year:", os.date("%j"))
Observe the output (Bug):
ISO 8601 (UTC): 2025-02-11T07:34:57Z<\0>
ISO 8601 (LOCAL): 2025-02-11T14:34:57Z
Standard Date: Tue Feb 11 14:34:57 2025
YYYY-MM-DD: 2025-02-11
24-hour Time: 14:34:57
12-hour Time: 02:34:57 PM
Day of the Week: Tuesday
Day of the Year: 042
This issue occurs in sandboxed Lua 5.4 and affects timestamps formatted in ISO 8601 (!%Y-%m-%dT%H:%M:%SZ), causing an unexpected null terminator (<\0>) at the end of the string.
Azael-Dev
changed the title
os.date() appends null terminator (\0) when using ISO 8601 format in sandboxed Lua 5.4
os.date() appends null terminator (\0) to ISO 8601 UTC timestamp in sandboxed Lua 5.4
Feb 11, 2025
What happened?
Starting from FXServer 12767, using
os.date("!%Y-%m-%dT%H:%M:%SZ", os.time())
with UTC formatting appends a null terminator (<\0>
) at the end of the string.Expected result
os.date("!%Y-%m-%dT%H:%M:%SZ", os.time())
should return a valid ISO 8601 timestamp without a null terminator (<\0>
).Reproduction steps
!%Y-%m-%dT%H:%M:%SZ
), causing an unexpected null terminator (<\0>
) at the end of the string.Importancy
There's a workaround
Area(s)
FXServer
Specific version(s)
Server 12767 windows
Additional information
This issue was introduced by commit:
76d4fc0
The text was updated successfully, but these errors were encountered: