cURL / Mailing Lists / curl-users / Single Mail

curl-users

[ curl-Bugs-820868 ] Redirection code 301 generate a segmentation fault

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 09 Oct 2003 13:44:46 -0700

Bugs item #820868, was opened at 2003-10-09 13:44
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=820868&group_id=976

Category: http
Group: crash
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: Redirection code 301 generate a segmentation fault

Initial Comment:
Hi Folks,
I'm using libCurl C interface (the latest version
7.10.7) on a Suse 8.2, PIII 1Go, 512Mo.
I think that I found a bug on "Redirection code 301".
When I try to fetch this URL :
 http://www.tf1.fr/TF1/Tr/Stats/Compteur/genereClickURL/1,,,00.html

I've got a segmentation fault error.
It seems that the page is "Moved Permanently 301" but
there is nothing in the "Location:" header to point the
new URL.

Could anyone fix it?
This is the headers with the verbose mode :

~/test> ./simple
* About to connect() to www.tf1.fr:80
* Connected to www.tf1.fr (195.68.47.6) port 80
> GET /TF1/Tr/Stats/Compteur/genereClickURL/1,,,00.html
HTTP/1.1
Host: www.tf1.fr
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*

< HTTP/1.1 301 Moved Permanently
HTTP/1.1 301 Moved Permanently
< Server: Microsoft-IIS/5.0
Server: Microsoft-IIS/5.0
< Date: Thu, 09 Oct 2003 20:28:21 GMT
Date: Thu, 09 Oct 2003 20:28:21 GMT
< Location:
Location:
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
< Via: 1.1 tx2 (Redline Networks Web I/O Accelerator -
T|X 3.1.0 0)
Via: 1.1 tx2 (Redline Networks Web I/O Accelerator -
T|X 3.1.0 0)

* Connection #0 left intact
Erreur de segmentation (<---segmentation fault)

This is my source code in "simple.c" :

#include <stdio.h>
#include <curl/curl.h>

int main(void)
{
  CURL *curl;
  CURLcode res;

  curl = curl_easy_init();
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
    curl_easy_setopt(curl, CURLOPT_HEADER, 1);
    curl_easy_setopt(curl, CURLOPT_URL,
"http://www.tf1.fr/TF1/Tr/Stats/Compteur/genereClickURL/1,,,00.html");
    res = curl_easy_perform(curl);

    printf ("res : %n", res);

    /* always cleanup */
    curl_easy_cleanup(curl);
  }
  return 0;
}

Thanks,
Younčs

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=820868&group_id=976

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
Received on 2003-10-09