From fd79125026278415e4176935ece937f5cc8d2144 Mon Sep 17 00:00:00 2001 From: Nefarius Date: Sat, 7 Jun 2014 12:22:37 +0200 Subject: [PATCH] =?UTF-8?q?Fixed=20crash=20caused=20by=20FileDownloader?= =?UTF-8?q?=C2=B4s=20unimplemented=20GetBuffer()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/curl/extension.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/curl/extension.cpp b/extensions/curl/extension.cpp index 336bbe0b3..0631d93b4 100644 --- a/extensions/curl/extension.cpp +++ b/extensions/curl/extension.cpp @@ -514,8 +514,11 @@ static cell_t HTTP_GetBodyContent(IPluginContext *pCtx, const cell_t *params) return pCtx->ThrowNativeError("Buffer too small\n"); } - memcpy(body, dldr->GetBuffer(), params[3]); - body[dldr->GetSize()] = '\0'; + if (dldr->GetBuffer() != NULL) + { + memcpy(body, dldr->GetBuffer(), params[3]); + body[dldr->GetSize()] = '\0'; + } return pCtx->StringToLocal(params[2], params[3], body); }