mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
imap-send: be more careful when casting to curl_off_t
When casting a `size_t` to `curl_off_t`, there is a currently uncommon chance that the value can be cut off (`curl_off_t` is expected to be a signed 64-bit data type). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e4efcd7060
commit
580cf0f2f6
@@ -1475,7 +1475,7 @@ static int curl_append_msgs_to_imap(struct imap_server_conf *server,
|
||||
lf_to_crlf(&msgbuf.buf);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
|
||||
(curl_off_t)(msgbuf.buf.len-prev_len));
|
||||
cast_size_t_to_curl_off_t(msgbuf.buf.len-prev_len));
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user