I just finished my struggle with libcurl and finally when everything compiled just great I got an error when sending an email. I copied the code from an example and just changed to my server port/login/password.
Here’s the error screenshot:
!http://wstaw.org/m/2011/08/22/error.png
And here’s the code I’m using: http://pastebin.com/3BTA1fUW
EDIT: CODE + CALLSTACK: http://pastebin.com/DijJnYH0
Your
payload_sourcefunction is ignoring thesizeandnmembparameters passed in.curl prepares a small buffer for you to write data into – the size of this buffer is given by
size * nmemb. You cannot insert any more thansize * nmembbytes; you have to wait for the next call. So if yourstrlen(data)turns out something longer thansize * nmemb, you write too much data and corrupt the heap. This can result in the crash you have shown.If fixing this does not fix your problem, please provide the rest of your code, and a copy of the stack trace.