fix the open proxy crash

This commit is contained in:
Fish 2006-01-07 13:50:24 +00:00
parent ee1f9b244e
commit 3303c2e97c
2 changed files with 8 additions and 5 deletions

View file

@ -1,8 +1,11 @@
Open Proxy Scanning Bot Module for NeoStats Changelog.
==============================================================================
3.0.b1 - Mark (M) & Fish (F) & DeadNotBuried (D)
- fix crash on adding new port
3.0.a3-dev - Mark (M) & Fish (F)
- fix crash on adding new port (D)
- Fix the open_proxy crash when a user had signed off and thus we had a
dangling pointer (F)
3.0.a3 - Mark (M) & Fish (F)
- AKILL support and open proxy reporting (F)
- Get default targetip when starting up correctly (F)
- Simplify command path. (M)

View file

@ -155,7 +155,7 @@ static void check_scan_free(scaninfo *scandata) {
checkqueue();
}
static void report_positive (const Client *u, const conninfo *connection)
static void report_positive (const char *hostip, const conninfo *connection)
{
MMessage *msg;
int32 *msgver;
@ -175,7 +175,7 @@ static void report_positive (const Client *u, const conninfo *connection)
proxy = MMPutStringField(msg, false, "Proxy", 1);
NeoVer = MMPutStringField(msg, false, "NeoVer", 1);
port = MMPutInt32Field(msg, false, "Port", 1);
host[0] = MBStrdupByteBuffer(u->hostip);
host[0] = MBStrdupByteBuffer(hostip);
proxy[0] = MBStrdupByteBuffer(type_of_proxy(connection->type));
NeoVer[0] = MBStrdupByteBuffer(MODULE_VERSION);
port[0] = connection->port;
@ -217,7 +217,7 @@ static void open_proxy(const conninfo *connection)
if (u) {
irc_prefmsg(opsb_bot, u, "An %s open proxy was found on port %d from your host. Please see http://secure.irc-chat.net/op.php?f=opsb&t=%d&p=%d&ip=%s", type_of_proxy(connection->type), connection->port, connection->type, connection->port, inet_ntoa(scandata->ip));
#ifndef WIN32
report_positive(u, connection);
report_positive(inet_ntoa(scandata->ip), connection);
#endif
}