Project

General

Profile

Enhancement #750 » 0009-sanitize-handle-more-config-errors-replace-int-1-typ.patch

Loïc Gomez, 2022-01-10 19:27

View differences:

src/bip.c
MOVE_STRING(s->host, t->pdata);
break;
case LEX_PORT:
s->port = t->ndata;
s->port = (unsigned short)t->ndata;
break;
default:
fatal("Config error in server block (%d)", t->type);
......
break;
#endif
case LEX_SERVER:
n->serverv = bip_realloc(n->serverv, (n->serverc + 1)
* sizeof(struct server));
if (n->serverc < 0) {
conf_die(bip, "internal error in network statement");
return 0;
}
n->serverv = bip_realloc(n->serverv,
(unsigned int)(n->serverc + 1) * sizeof(struct server));
n->serverc++;
memset(&n->serverv[n->serverc - 1], 0,
sizeof(struct server));
src/connection.c
return 1;
}
break;
default:
mylog(LOG_ERROR, "Unknown ssl_check_mode (%d)!", cn->ssl_check_mode);
return 1;
}
if (err2 == SSL_ERROR_SYSCALL) {
......
switch (conn->ssl_check_mode) {
struct stat st_buf;
case SSL_CHECK_NONE:
break;
case SSL_CHECK_BASIC:
if (!SSL_CTX_load_verify_locations(conn->ssl_ctx_h, check_store,
NULL)) {
src/irc.c
break;
#endif
default:
fatal("gnéééééé");
fatal("irc_dispatch: unknown IRC_TYPE_SERVER");
}
return ERR_PROTOCOL; /* never reached */
}
src/irc.h
char *default_realname;
/* backlog options */
int backlog:1;
char backlog;
int backlog_lines;
int always_backlog:1;
int bl_msg_only:1;
int blreset_on_talk:1;
int blreset_connection:1;
char always_backlog;
char bl_msg_only;
char blreset_on_talk;
char blreset_connection;
enum BLTimestamp backlog_timestamp;
......
#endif
hash_t connections;
int in_use:1; /* for mark and sweep on reload */
char in_use; /* for mark and sweep on reload */
};
struct network
......
/** link options */
int follow_nick:1;
int ignore_first_nick:1;
int autojoin_on_kick:1;
int ignore_server_capab:1;
char follow_nick;
char ignore_first_nick;
char autojoin_on_kick;
char ignore_server_capab;
list_t on_connect_send;
char *no_client_away_msg;
char *away_nick;
(8-8/24)