We ran into a crash with libcurl where the branch at the following line is taken, after the check for writebytecount for http
Following stacktrace was reached, which caused a crash. I believe it's due to the lack of a protocol check before doing the writebytecount
#0 0x0000003ddd761c31 in fseek () from /lib64/tls/libc.so.6
#1 0x00000000010d704a in Curl_readrewind (conn=Variable "conn" is not available.) at transfer.c:308
#2 0x00000000010d8cac in Curl_retry_request (conn=0x2aa0f27740, url=0x40f1c680) at transfer.c:2104
#3 0x00000000010d9103 in Curl_do_perform (data=0x2aa88e5e30) at transfer.c:2156
Note that at this point, protocol is SFTP, not HTTP
See attached patch for proposed fix.
Curllib version 7.21.6, but I think latest has it as well.