1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-07 19:13:20 +00:00

Fixed Buffer, so if the buffer contains a NULL, the string is truncated at the NULL

This commit is contained in:
Bryan Roe
2019-01-17 18:48:47 -08:00
parent 51a8b5c44d
commit 1e537debfb

View File

@@ -288,7 +288,7 @@ duk_ret_t ILibDuktape_Polyfills_Buffer_toString(duk_context *ctx)
if (nargs == 0)
{
// Just convert to a string
duk_push_lstring(ctx, buffer, bufferLen); // [buffer][string]
duk_push_lstring(ctx, buffer, strnlen_s(buffer, bufferLen)); // [buffer][string]
}
else
{