cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Bug !!! Redirection code 301 generate a segmentation fault

From: codemastr <codemstr_at_ptd.net>
Date: Thu, 9 Oct 2003 17:47:08 -0400

Always try using a debugger before blaming someone else. The problem doesn't
have anything to do with libcurl. The problem is you are using %n
incorrectly. You have:

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

I have no idea what the purpose of this line is, but it is wrong. %n expects
an int *, res is not an int *, it's a CURLcode. And, that can and should
cause a segfault. CURLcode is an enumeration, the compiler probably treats
it as an integer here. So it reads res, (which is 0 to indicate no error
occurred) and therefore you're telling it to read from memory address
00000000 which is illegal. As I said, always use a debugger, if you looked
at it in gdb it would be clear that it died due to printf.

Dominick Meglio

-------------------------------------------------------
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