struct BlacklistStats *stats;
char *blacklist = source_p->preClient->auth.data;
- if((stats = rb_dictionary_retrieve(bl_stats, blacklist)) != NULL)
- stats->hits++;
+ if(bl_stats != NULL)
+ if((stats = rb_dictionary_retrieve(bl_stats, blacklist)) != NULL)
+ stats->hits++;
if(IsExemptKline(source_p) || IsConfExemptDNSBL(aconf))
{
register_local_user(struct Client *client_p, struct Client *source_p)
{
struct ConfItem *aconf, *xconf;
- struct User *user = source_p->user;
char tmpstr2[BUFSIZE];
char ipaddr[HOSTIPLEN];
char myusername[USERLEN+1];
{
if(!(source_p->flags & FLAGS_PINGSENT) && source_p->localClient->random_ping == 0)
{
- source_p->localClient->random_ping = (unsigned long) (rand() * rand()) << 1;
- sendto_one(source_p, "PING :%08lX",
- (unsigned long) source_p->localClient->random_ping);
+ source_p->localClient->random_ping = (uint32_t)(((rand() * rand()) << 1) | 1);
+ sendto_one(source_p, "PING :%08X",
+ (unsigned int) source_p->localClient->random_ping);
source_p->flags |= FLAGS_PINGSENT;
return -1;
}
}
}
- if(IsNeedSasl(aconf) && !*user->suser)
+ if(IsNeedSasl(aconf) && !*source_p->user->suser)
{
ServerStats.is_ref++;
sendto_one_notice(source_p, ":*** Notice -- You need to identify via SASL to use this server");
*/
if(!*source_p->id)
{
- strcpy(source_p->id, generate_uid());
+ rb_strlcpy(source_p->id, generate_uid(), sizeof(source_p->id));
add_to_id_hash(source_p->id, source_p);
}
free_pre_client(source_p);
- introduce_client(client_p, source_p, user, source_p->name, 1);
+ introduce_client(client_p, source_p, source_p->user, source_p->name, 1);
return 0;
}
if (user_modes[i] == 0)
{
orphaned_umodes |= prev_user_modes[i];
- sendto_realops_snomask(SNO_DEBUG, L_ALL, "Umode +%c is now orphaned", i);
+ user_modes[i] = prev_user_modes[i];
}
else
- {
orphaned_umodes &= ~prev_user_modes[i];
- sendto_realops_snomask(SNO_DEBUG, L_ALL, "Orphaned umode +%c is picked up by module", i);
- }
- user_modes[i] = prev_user_modes[i];
}
else
prev_user_modes[i] = user_modes[i];
+
if (user_modes[i])
*ptr++ = (char) i;
}