mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-15 08:31:35 +00:00
Merge pull request #1168 from SiemensSchuckert/HTTP_dnl1
fix HTTP download crash (on empty file)
This commit is contained in:
commit
bc168a7bfa
1 changed files with 7 additions and 0 deletions
|
@ -264,6 +264,9 @@ static void CL_StartHTTPDownload (dlqueue_t *entry, dlhandle_t *dl)
|
|||
}
|
||||
|
||||
// Make sure that the download handle is in empty state.
|
||||
if (dl->tempBuffer) {
|
||||
free(dl->tempBuffer);
|
||||
}
|
||||
dl->tempBuffer = NULL;
|
||||
dl->fileSize = 0;
|
||||
dl->position = 0;
|
||||
|
@ -477,6 +480,10 @@ static void CL_ParseFileList(dlhandle_t *dl)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!dl->tempBuffer) {
|
||||
return;
|
||||
}
|
||||
|
||||
char *list = dl->tempBuffer;
|
||||
|
||||
for (;;)
|
||||
|
|
Loading…
Reference in a new issue