Skip to content

Commit e1d5a85

Browse files
committed
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 supposed to be guaranteed to be 64-bit). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7caaec9 commit e1d5a85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imap-send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ static int curl_append_msgs_to_imap(struct imap_server_conf *server,
17211721
lf_to_crlf(&msgbuf.buf);
17221722

17231723
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
1724-
(curl_off_t)(msgbuf.buf.len-prev_len));
1724+
cast_size_t_to_curl_off_t(msgbuf.buf.len-prev_len));
17251725

17261726
res = curl_easy_perform(curl);
17271727

0 commit comments

Comments
 (0)