svn: 1479
@@ -1280,7 +1280,7 @@ static void dcc_telnet_dns_callback(void *client_data, const char *ip, char **ho
return;
}
- if (idx < 0 || !dcc[idx].type) {
+ if (!valid_idx(idx)) {
putlog(LOG_BOTS, "*", "Lost listening socket while resolving %s", dcc[i].host);
killsock(dcc[i].sock);
lostdcc(i);
@@ -767,3 +767,10 @@ void identd_close()
+
+bool valid_idx(int idx)
+{
+ if ((idx == -1) || (idx >= dcc_total) || (!dcc[idx].type))
+ return 0;
+ return 1;
+}
@@ -47,6 +47,7 @@ int detect_dcc_flood(time_t *, struct chat_info *, int);
void identd_open();
void identd_close();
port_t listen_all(port_t, bool);
+bool valid_idx(int);
extern int max_dcc;
extern time_t connect_timeout;