cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: POST and Expect: header

From: Duncan Wilcox <duncan_at_mclink.it>
Date: Wed, 22 Jan 2003 11:08:51 +0100

> Have a check, and please ask if there's anything more I can point out.

Thanks, I'll try looking into this.

> > Another minor problem I'm having is that curl --interface will coredump,
> > maybe there's an easy fix for this.
>
> Ugha! Didn't know that. Can you please provide us with a stack backtrace
(or
> even a fix)? I can't seem to make it crash on my Linux box (testing right
> now).

It kills the stack and dies with a bus error when returning, so it wasn't
very easy to find, but it appears to be around lib/connect.c:256:

#ifdef ENABLE_IPV6
        memcpy((char *)&sa.sin_addr, addr->ai_addr, addr->ai_addrlen);
        sa.sin_family = addr->ai_family;
#else

that memcpy is copying 16 bytes worth of stuff in a space for 4 (at least on
FreeBSD sin_addr is an in_addr_t that is an u_int32_t), so it ends up
overwriting part of the stack. Maybe on Linux sin_addr is larger or maybe
the sockaddr_in has more space in it?

The bug doesn't happen if I configure --disable-ipv6, so I think I nailed
it, but I'm not very confident with ipv6 stuff, so I don't really know how
to fix it.

Hope this helps.

Duncan

-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
Received on 2003-01-22