We ran into a crash with libcurl where the branch at the following line is taken, after the check for writebytecount for http
https://github.com/bagder/curl/blob/master/lib/transfer.c line 2059
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.
Thanks.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
patch file for transfer.c
Last edit: Anonymous 2021-09-01
Thanks for the report, this problem is now fixed in the git repository.
To try it out, you either checkout/update your git clone: http://curl.haxx.se/source.html
or you try tomorrow's daily snapshot: http://curl.haxx.se/snapshots/