summarylogtreecommitdiffstats
path: root/fix_double_free.patch
blob: 6482be191b508a9e15b30bbe14035a958034df84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/old/source/ikec/main.cpp b/new/source/ikec/main.cpp
index 488b92b..c6cf19b 100644
--- a/source/ikec/main.cpp
+++ b/source/ikec/main.cpp
@@ -72,7 +72,9 @@ int main( int argc, char ** argv )
 
 		if( ikec.auto_connect() )
 			ikec.vpn_connect( true );
-	}
+	} else {
+            return 0;
+        }
 
 	// process user input
 
diff --git a/old/source/libike/manager.file.cpp b/new/source/libike/manager.file.cpp
index 113486a..42d2938 100644
--- a/source/libike/manager.file.cpp
+++ b/source/libike/manager.file.cpp
@@ -178,6 +178,11 @@ bool _CONFIG_MANAGER::file_vpn_load( CONFIG & config )
 	else
 		path.add( sites_user );
 
+        if (path.size() == 0) {
+            //Empty path. Below ins will fail with -1, so abort now.
+            return false;
+        }
+
 	path.ins( PATH_DELIM, 1, path.size() - 1 );
 	path.ins( config.get_id(), strlen( config.get_id() ), path.size() - 1 );