1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-04 17:43:45 +00:00

Fixed bug where if a proxy isn't set, it could cause a segfault on FreeBSD

This commit is contained in:
Bryan Roe
2019-08-24 00:45:12 -07:00
parent 84882e0b52
commit fcea5a600a

View File

@@ -462,7 +462,7 @@ int MeshAgent_GetSystemProxy(MeshAgentHostContainer *agent, char *buffer, size_t
{
duk_size_t proxyLen;
char *proxy = (char*)duk_get_lstring(agent->meshCoreCtx, -1, &proxyLen);
strcpy_s(buffer, bufferSize, proxy);
if (proxy != NULL && proxyLen > 0) { strcpy_s(buffer, bufferSize, proxy); }
retVal = (int)proxyLen;
}
duk_pop(agent->meshCoreCtx);