From fed52fac19d20713c1df00a2a94f35d2972cb6f2 Mon Sep 17 00:00:00 2001 From: anders_k Date: Thu, 10 Sep 2015 12:05:50 +0000 Subject: [PATCH] * Be extra careful with zero termination of the foreign update status string * Always include Wininet.h git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6605 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Makensisw/update.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Contrib/Makensisw/update.cpp b/Contrib/Makensisw/update.cpp index e2aabbce..8d4728fb 100644 --- a/Contrib/Makensisw/update.cpp +++ b/Contrib/Makensisw/update.cpp @@ -2,6 +2,7 @@ #include "makensisw.h" #include "update.h" +#include #include "utils.h" // OpenUrlInDefaultBrowser #define mbtitle "NSIS Update" @@ -78,9 +79,9 @@ static DWORD CALLBACK UpdateCheckWebrequestThread(LPVOID ThreadParam) gle = GetLastError(); if (hConn) { - char response[30]; + char response[30+1]; DWORD cbRecv; - gle = InetSynchronousReadFile(hConn, response, sizeof(response), &cbRecv); + gle = InetSynchronousReadFile(hConn, response, sizeof(response)-1, &cbRecv); if (!gle) { response[cbRecv] = '\0';