403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.238
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/net/freeradius-client/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/net/freeradius-client/files/patch-lib__config.c
--- lib/config.c.orig	2015-01-19 16:18:26 UTC
+++ lib/config.c
@@ -106,7 +106,7 @@ static int set_option_srv(char const *filename, int li
 	serv = (SERVER *) option->val;
 	if (serv == NULL) {
 		DEBUG(LOG_ERR, "option->val / server is NULL, allocating memory");
-		serv = malloc(sizeof(*serv));
+		serv = calloc(1, sizeof(*serv));
 		if (serv == NULL) {
 			rc_log(LOG_CRIT, "read_config: out of memory");
 			free(p_dupe);
@@ -319,8 +319,8 @@ rc_config_init(rc_handle *rh)
 
 	acct = find_option(rh, "acctserver", OT_ANY);
 	auth = find_option(rh, "authserver", OT_ANY);
-	authservers = malloc(sizeof(SERVER));
-	acctservers = malloc(sizeof(SERVER));
+	authservers = calloc(1, sizeof(SERVER));
+	acctservers = calloc(1, sizeof(SERVER));
 
 	if(authservers == NULL || acctservers == NULL)
 	{
@@ -504,7 +504,7 @@ int rc_conf_int(rc_handle const *rh, char const *optna
 
 	if (option != NULL) {
 		if (option->val) {
-			return *((int *)option->val);
+			return option->val ? *((int *)option->val) : 0;
 		} else {
 			rc_log(LOG_ERR, "rc_conf_int: config option %s was not set", optname);
 			return 0;
@@ -545,17 +545,21 @@ int test_config(rc_handle const *rh, char const *filen
 	struct stat st;
 	char	    *file;
 #endif
+	SERVER *srv = NULL;
 
-	if (!(rc_conf_srv(rh, "authserver")->max))
+	srv = rc_conf_srv(rh, "authserver");
+	if (!srv || !srv->max)
 	{
 		rc_log(LOG_ERR,"%s: no authserver specified", filename);
 		return -1;
 	}
-	if (!(rc_conf_srv(rh, "acctserver")->max))
+	srv = rc_conf_srv(rh, "acctserver");
+	if (!srv || !srv->max)
 	{
 		rc_log(LOG_ERR,"%s: no acctserver specified", filename);
 		return -1;
 	}
+
 	if (!rc_conf_str(rh, "servers"))
 	{
 		rc_log(LOG_ERR,"%s: no servers file specified", filename);

Youez - 2016 - github.com/yon3zu
LinuXploit