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
110 110
			MOVE_STRING(s->host, t->pdata);
111 111
			break;
112 112
		case LEX_PORT:
113
			s->port = t->ndata;
113
			s->port = (unsigned short)t->ndata;
114 114
			break;
115 115
		default:
116 116
			fatal("Config error in server block (%d)", t->type);
......
316 316
			break;
317 317
#endif
318 318
		case LEX_SERVER:
319
			n->serverv = bip_realloc(n->serverv, (n->serverc + 1)
320
						* sizeof(struct server));
319
			if (n->serverc < 0) {
320
				conf_die(bip, "internal error in network statement");
321
				return 0;
322
			}
323

  
324
			n->serverv = bip_realloc(n->serverv,
325
					(unsigned int)(n->serverc + 1) * sizeof(struct server));
321 326
			n->serverc++;
322 327
			memset(&n->serverv[n->serverc - 1], 0,
323 328
					sizeof(struct server));
src/connection.c
1495 1495
			return 1;
1496 1496
		}
1497 1497
		break;
1498
	default:
1499
		mylog(LOG_ERROR, "Unknown ssl_check_mode (%d)!", cn->ssl_check_mode);
1500
		return 1;
1498 1501
	}
1499 1502

  
1500 1503
	if (err2 == SSL_ERROR_SYSCALL) {
......
1532 1535

  
1533 1536
	switch (conn->ssl_check_mode) {
1534 1537
	struct stat st_buf;
1538
	case SSL_CHECK_NONE:
1539
		break;
1535 1540
	case SSL_CHECK_BASIC:
1536 1541
		if (!SSL_CTX_load_verify_locations(conn->ssl_ctx_h, check_store,
1537 1542
				NULL)) {
src/irc.c
1359 1359
		break;
1360 1360
#endif
1361 1361
	default:
1362
		fatal("gnéééééé");
1362
		fatal("irc_dispatch: unknown IRC_TYPE_SERVER");
1363 1363
	}
1364 1364
	return ERR_PROTOCOL; /* never reached */
1365 1365
}
src/irc.h
76 76
	char *default_realname;
77 77

  
78 78
	/* backlog options */
79
	int backlog:1;
79
	char backlog;
80 80
	int backlog_lines;
81
	int always_backlog:1;
82
	int bl_msg_only:1;
83
	int blreset_on_talk:1;
84
	int blreset_connection:1;
81
	char always_backlog;
82
	char bl_msg_only;
83
	char blreset_on_talk;
84
	char blreset_connection;
85 85

  
86 86
	enum BLTimestamp backlog_timestamp;
87 87

  
......
92 92
#endif
93 93

  
94 94
	hash_t connections;
95
	int in_use:1; /* for mark and sweep on reload */
95
	char in_use; /* for mark and sweep on reload */
96 96
};
97 97

  
98 98
struct network
......
136 136

  
137 137
	/** link options */
138 138

  
139
	int follow_nick:1;
140
	int ignore_first_nick:1;
141
	int autojoin_on_kick:1;
142
	int ignore_server_capab:1;
139
	char follow_nick;
140
	char ignore_first_nick;
141
	char autojoin_on_kick;
142
	char ignore_server_capab;
143 143
	list_t on_connect_send;
144 144
	char *no_client_away_msg;
145 145
	char *away_nick;
146
- 
(8-8/24)