You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Thibault, thanks for the project, I've been using it for a while and it's wonderful.
Recently I've noticed some suspicious crashes happening and I'm able to narrow it down to the callback block of startDownloadWithURL:customPath:firstResponse:progress:error:complete:method. Turns out the totalLength parameter in progressBlock sometimes returns the maximum value of UInt64, so when I assign it to a 64-bit NSNumber, it causes a segmentation fault.
the expectedContentLength property of NSURLResponse returns -1 if there is no expectation that can be arrived, at the same time if I pause and resume a download, sometimes receivedDataLength could be 0 (not sure why), so here you could be assigning minus value to expectedDataLength which is a uint64_t. I suggest to check the value before the assignment.
Meanwhile,I'm using TCBlobDownload in my swift project at the moment. I should take your advice and switch to the newest swift version. Again thanks for your hard work :)
The text was updated successfully, but these errors were encountered:
Hi Thibault, thanks for the project, I've been using it for a while and it's wonderful.
Recently I've noticed some suspicious crashes happening and I'm able to narrow it down to the callback block of
startDownloadWithURL:customPath:firstResponse:progress:error:complete:
method. Turns out thetotalLength
parameter inprogressBlock
sometimes returns the maximum value ofUInt64
, so when I assign it to a 64-bitNSNumber
, it causes a segmentation fault.on Line 205 of
TCBlobDownload.m
I found:the
expectedContentLength
property ofNSURLResponse
returns -1 if there is no expectation that can be arrived, at the same time if I pause and resume a download, sometimesreceivedDataLength
could be 0 (not sure why), so here you could be assigning minus value toexpectedDataLength
which is auint64_t
. I suggest to check the value before the assignment.Meanwhile,I'm using TCBlobDownload in my swift project at the moment. I should take your advice and switch to the newest swift version. Again thanks for your hard work :)
The text was updated successfully, but these errors were encountered: