From e527b9ee64f86f708b1ec952e01d2a0cbe9a9350 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Thu, 23 Jun 2016 09:27:15 +0100 Subject: [PATCH] print error message instead of segfaulting for invalid chain_len closes #126 --- src/libproxychains.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libproxychains.c b/src/libproxychains.c index b9ffab9..1240448 100644 --- a/src/libproxychains.c +++ b/src/libproxychains.c @@ -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")) {