Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
c-hyper: don't write to set.writeheader if null
Previously if a caller set CURLOPT_WRITEFUNCTION but did not set a CURLOPT_HEADERDATA buffer, Hyper would still attempt to write headers to the data->set.writeheader header buffer, even though it is null. This led to NPE segfaults attempting to use libcurl+Hyper with Git, for example. Instead, process the client write for the status line using the same logic we use to process the client write for the later HTTP headers, which contains the appropriate guard logic. As a side benefit, data->set.writeheader is now only read in one file instead of two. Fixes curl#6619. Fixes rustls/rustls-ffi#49. Fixes hyperium/hyper#2438.
- Loading branch information