浏览代码

UI/updater: Fixed a bug with deflating

The file could deflate infinitely until hard drive space ran out.
jp9000 8 年之前
父节点
当前提交
77ceb97f96
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      UI/win-update/updater/http.cpp

+ 3 - 3
UI/win-update/updater/http.cpp

@@ -293,10 +293,10 @@ static bool ReadHTTPZippedFile(z_stream *strm, HANDLE updateFile,
 		string &zipBuf, const uint8_t *buffer, DWORD outSize,
 		int *responseCode)
 {
-	do {
-		strm->avail_in = outSize;
-		strm->next_in  = buffer;
+	strm->avail_in = outSize;
+	strm->next_in  = buffer;
 
+	do {
 		strm->avail_out = (uInt)zipBuf.size();
 		strm->next_out  = (Bytef *)zipBuf.data();