From 8a6619c0a86f161297ffcd139add652694cb52b3 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Thu, 4 Mar 2004 19:33:59 +0000 Subject: [PATCH] - Fixed yet another fun remote includes memory corruption crash bug due to curl strangeness (took me 2 hours to trace down, great!). --- Changes | 2 ++ doc/unreal32docs.html | 4 ++-- src/url.c | 17 +++++++++++------ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Changes b/Changes index ee4485149..dae4a3a48 100644 --- a/Changes +++ b/Changes @@ -2991,3 +2991,5 @@ seen. gmtime warning still there - Cosmetic doc updates (#0001596) reported by HERZ. - Updated SSL error for underlying syscall error a bit (#0001615). - Minor doc updates on SSL (mIRC now supports SSL a bit). +- Fixed yet another fun remote includes memory corruption crash bug due + to curl strangeness (took me 2 hours to trace down, great!). diff --git a/doc/unreal32docs.html b/doc/unreal32docs.html index 8a3fc2b52..dc7bea458 100644 --- a/doc/unreal32docs.html +++ b/doc/unreal32docs.html @@ -21,7 +21,7 @@ http://www.unrealircd.com
Version: 3.2
Current Version: 3.2 RC1 *CVS*
- Last doc update: 2004-03-03 + Last doc update: 2004-03-04 Head Coders: Stskeeps / codemastr / Syzop / Luke / McSkaf
Contributors: Zogg / NiQuiL / assyrian / chasm / DrBin / llthangel / Griever / nighthawk
Documentation: CKnight^ / Syzop
@@ -1877,7 +1877,7 @@ spamfilter {

regex is the regex to be matched.
target specifies the targets, possible targets are: channel, private, private-notice, channel-notice, part, quit, dcc.
- action specifies the action to be taken, possible values are: kill, tempshun, shun, kline, gline, zline, gzline, block
+ action specifies the action to be taken, see here for a list of possible actions.
reason optional: specifies the ban or block reason, else the default is used.
ban-time optional: specifies the duration of a *line ban, else the default is used (1 day).

diff --git a/src/url.c b/src/url.c index b5a048c03..2a272cc6e 100644 --- a/src/url.c +++ b/src/url.c @@ -316,10 +316,11 @@ void url_do_transfers_async(void) char *url; long code; long last_mod; - curl_easy_getinfo(msg->easy_handle, CURLINFO_RESPONSE_CODE, &code); - curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, (char*)&handle); - curl_easy_getinfo(msg->easy_handle, CURLINFO_EFFECTIVE_URL, &url); - curl_easy_getinfo(msg->easy_handle, CURLINFO_FILETIME, &last_mod); + CURL *easyhand = msg->easy_handle; + curl_easy_getinfo(easyhand, CURLINFO_RESPONSE_CODE, &code); + curl_easy_getinfo(easyhand, CURLINFO_PRIVATE, (char*)&handle); + curl_easy_getinfo(easyhand, CURLINFO_EFFECTIVE_URL, &url); + curl_easy_getinfo(easyhand, CURLINFO_FILETIME, &last_mod); fclose(handle->fd); #if defined(IRC_UID) && defined(IRC_GID) if (!loop.ircd_booted) @@ -347,8 +348,12 @@ void url_do_transfers_async(void) remove(handle->filename); } free(handle); - curl_multi_remove_handle(multihandle, msg->easy_handle); - curl_easy_cleanup(msg->easy_handle); + curl_multi_remove_handle(multihandle, easyhand); + /* NOTE: after curl_multi_remove_handle() you cannot use + * 'msg' anymore because it has freed by curl (as of v7.11.0), + * therefore 'easyhand' is used... fun! -- Syzop + */ + curl_easy_cleanup(easyhand); } } }