Open
Description
curl::easy::Easy2::default_configure
registers an error buffer like this:
self.setopt_ptr(
curl_sys::CURLOPT_ERRORBUFFER,
self.inner.error_buf.borrow().as_ptr() as *const _,
)
.expect("failed to set error buffer");
CURLOPT_ERRORBUFFER
requires mutable access over the buffer, and it is important that the buffer pointer is still valid later on when further library calls are made. However, error_buf
is borrowed immutably and only for a short time (until the end of the statement).
(A mutable borrow might look like this:
self.inner.error_buf.borrow_mut().as_mut_ptr() as *const u8 as *const _
That does not solve the lifetime problem, though.)
Metadata
Metadata
Assignees
Labels
No labels