mirror of
https://github.com/curl/curl.git
synced 2026-05-30 04:07:27 +03:00
libssh: catch a resume point larger than the size
As it would otherwise trigger broken math Reported-by: Joshua Rogers Closes #19044
This commit is contained in:
parent
5e74b2df34
commit
6d0fcdf2ed
1 changed files with 4 additions and 0 deletions
|
|
@ -1239,6 +1239,10 @@ static int myssh_in_UPLOAD_INIT(struct Curl_easy *data,
|
|||
|
||||
/* now, decrease the size of the read */
|
||||
if(data->state.infilesize > 0) {
|
||||
if(data->state.resume_from > data->state.infilesize) {
|
||||
failf(data, "Resume point beyond size");
|
||||
return myssh_to_ERROR(data, sshc, CURLE_BAD_FUNCTION_ARGUMENT);
|
||||
}
|
||||
data->state.infilesize -= data->state.resume_from;
|
||||
data->req.size = data->state.infilesize;
|
||||
Curl_pgrsSetUploadSize(data, data->state.infilesize);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue