Fixed crash caused by FileDownloader´s unimplemented GetBuffer()

This commit is contained in:
Nefarius 2014-06-07 12:22:37 +02:00 committed by Nicholas Hastings
parent a3b3719254
commit fd79125026

View File

@ -514,8 +514,11 @@ static cell_t HTTP_GetBodyContent(IPluginContext *pCtx, const cell_t *params)
return pCtx->ThrowNativeError("Buffer too small\n");
}
if (dldr->GetBuffer() != NULL)
{
memcpy(body, dldr->GetBuffer(), params[3]);
body[dldr->GetSize()] = '\0';
}
return pCtx->StringToLocal(params[2], params[3], body);
}