mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-06 18:23:12 +02:00
Another URL API fix
This commit is contained in:
+7
-2
@@ -824,9 +824,14 @@ int https_handle_response_header(Download *handle, char *readbuf, int n)
|
||||
}
|
||||
}
|
||||
|
||||
if (lastloc)
|
||||
if (!end_of_request && lastloc)
|
||||
{
|
||||
/* Last line was cut somewhere, save it for next round. */
|
||||
/* Save a cut-off (incomplete) header line for the next packet.
|
||||
* Only while still reading headers: once end_of_request is set,
|
||||
* lastloc points at body data that https_handle_response_body()
|
||||
* already owns via handle->lefttoparse/lefttoparselen, so touching
|
||||
* it here would desync those two and cause an out-of-bounds read.
|
||||
*/
|
||||
safe_strdup(handle->lefttoparse, lastloc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user