Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Headers] segmentation fault on init / add #23

Closed
susnux opened this issue Jan 24, 2015 · 0 comments
Closed

[Headers] segmentation fault on init / add #23

susnux opened this issue Jan 24, 2015 · 0 comments

Comments

@susnux
Copy link
Contributor

susnux commented Jan 24, 2015

I have tested this library, but I always got a segmentation fault in:
void curl_header::add(const string header)

After some tests I noticed it is this line:
this->headers = curl_slist_append(this->headers,header.c_str());

I compiled against libcurl 7.38.0 and compiled with no special flags (except maybe -fPIC).
My example to reproduce:

std::initializer_list<std::string> headers = {
    "User-Agent: Mozilla/5.0",
    "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
    "Accept-Encoding: gzip,deflate"};
std::ostringstream resultStream;
curl_writer writer(resultStream);
curl_form form;
curl_easy easy(writer);
curl_header header(headers);
//Never reaches this point```
susnux added a commit to susnux/curlcpp that referenced this issue Jan 24, 2015
JosephP91 added a commit that referenced this issue Jan 24, 2015
Fixed segmentation fault on header init (Issue #23)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants