mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2024-12-22 12:18:47 +00:00
libproxychains.c: fix NULL pointer dereference after fopen().
if a configuration file can be accessed by proxychains but there is a mandatory access control (or other) block on the target appication's ability to read that file, fopen() creates a NULL pointer that will cause a segfault in fgets(). closes #17 Signed-off-by: mancha <mancha1@hush.com>
This commit is contained in:
parent
8a93f45007
commit
2aba83087e
@ -168,7 +168,11 @@ static void get_chain_data(proxy_data * pd, unsigned int *proxy_count, chain_typ
|
|||||||
*ct = DYNAMIC_TYPE;
|
*ct = DYNAMIC_TYPE;
|
||||||
|
|
||||||
env = get_config_path(getenv(PROXYCHAINS_CONF_FILE_ENV_VAR), buff, sizeof(buff));
|
env = get_config_path(getenv(PROXYCHAINS_CONF_FILE_ENV_VAR), buff, sizeof(buff));
|
||||||
file = fopen(env, "r");
|
if( ( file = fopen(env, "r") ) == NULL )
|
||||||
|
{
|
||||||
|
perror("couldnt read configuration file");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
env = getenv(PROXYCHAINS_QUIET_MODE_ENV_VAR);
|
env = getenv(PROXYCHAINS_QUIET_MODE_ENV_VAR);
|
||||||
if(env && *env == '1')
|
if(env && *env == '1')
|
||||||
|
Loading…
Reference in New Issue
Block a user