From fe95cb9a1fbf1a36e21872cec3ef9999a4e32c4c Mon Sep 17 00:00:00 2001 From: stskeeps Date: Sat, 19 Aug 2000 14:28:23 +0000 Subject: [PATCH] + and dynconf, chrestrict --- Changes | 2 ++ src/dynconf.c | 16 +++++++++++++--- src/s_extra.c | 7 ++++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 64d2a0994..b0ca780b7 100644 --- a/Changes +++ b/Changes @@ -562,3 +562,5 @@ it encrypts X and N lines too. - Fixed empty mode sends in register_user, reported by Bagge - Added some portability stuff +- Fixed some empty-line/missing parameter stuff in dccdeny, vhost, + and dynconf, chrestrict diff --git a/src/dynconf.c b/src/dynconf.c index 9ed3ee460..e73d6ac0b 100644 --- a/src/dynconf.c +++ b/src/dynconf.c @@ -118,7 +118,8 @@ int load_conf(char *filename, int type) iCstrip(buf); version = strtok(buf, "^"); version = strtok(NULL, ""); - + if (!version) + goto malformed; /* is this a unrealircd.conf file? */ if (!match("1.*", version)) { @@ -189,6 +190,7 @@ int load_conf(char *filename, int type) } else { +malformed: if (type == 1) { sendto_ops @@ -255,8 +257,12 @@ int load_conf2(FILE * conf, char *filename, int type) if (*var == '\0') continue; - strtok(NULL, " "); + setto = strtok(NULL, " "); + if (!setto) + continue; setto = strtok(NULL, ""); + if (!setto) + continue; /* Is it a aint variable */ if (strcmp(var, "MODE_X") == 0) { @@ -428,8 +434,12 @@ int load_conf3(FILE * conf, char *filename, int type) if (*var == '\0') continue; - strtok(NULL, " "); + setto = strtok(NULL, " "); + if (!setto) + continue; setto = strtok(NULL, ""); + if (!setto) + continue; /* Is it a aint variable */ if (strcmp(var, "iNAH") == 0) { diff --git a/src/s_extra.c b/src/s_extra.c index d90c09b3a..aa4b289c6 100644 --- a/src/s_extra.c +++ b/src/s_extra.c @@ -271,6 +271,8 @@ int dcc_loadconf(void) if (buf[0] == '#' || buf[0] == '/' || buf[0] == '\0') continue; iCstrip(buf); + if (buf[0] == '#' || buf[0] == '/' || buf[0] == '\0') + continue; x = strtok(buf, " "); if (strcmp("deny", x) == 0) { @@ -526,6 +528,8 @@ int cr_loadconf(void) if (buf[0] == '#' || buf[0] == '/' || buf[0] == '\0') continue; iCstrip(buf); + if (buf[0] == '#' || buf[0] == '/' || buf[0] == '\0') + continue; x = strtok(buf, " "); if (strcmp("allow", x) == 0) { @@ -668,9 +672,10 @@ int vhost_loadconf(void) while (fgets(buf, 2048, f)) { if (buf[0] == '#' || buf[0] == '/' || buf[0] == '\0') - continue; iCstrip(buf); + if (buf[0] == '#' || buf[0] == '/' || buf[0] == '\0') + continue; x = strtok(buf, " "); if (strcmp("vhost", x) == 0) {