print error message instead of segfaulting for invalid chain_len

closes #126
This commit is contained in:
rofl0r 2016-06-23 09:27:15 +01:00
parent 635ded3393
commit e527b9ee64

View File

@ -285,6 +285,10 @@ static void get_chain_data(proxy_data * pd, unsigned int *proxy_count, chain_typ
char *pc;
int len;
pc = strchr(buff, '=');
if(!pc) {
fprintf(stderr, "error: missing equals sign '=' in chain_len directive.\n");
exit(1);
}
len = atoi(++pc);
proxychains_max_chain = (len ? len : 1);
} else if(strstr(buff, "quiet_mode")) {