File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
java/com/samsung/microbit/utils Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1515-->
1616<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
1717 xmlns : tools =" http://schemas.android.com/tools"
18- android : versionCode =" 55 "
19- android : versionName =" 3.0.5 " >
18+ android : versionCode =" 56 "
19+ android : versionName =" 3.0.6 " >
2020
2121 <uses-permission android : name =" android.permission.ACCESS_NETWORK_STATE" />
2222 <uses-permission android : name =" android.permission.ACCESS_WIFI_STATE" />
Original file line number Diff line number Diff line change @@ -205,13 +205,18 @@ public static boolean installSamples( Context context) {
205205 while ((ze = zin .getNextEntry ()) != null ) {
206206 Log .v ("MicroBit" , "Unzipping " + ze .getName ());
207207
208+ File f = projectFile (context , ze .getName ());
209+ if (!f .getCanonicalPath ().startsWith (projectRoot (context ).getCanonicalPath ())) {
210+ // Skip file with unexpected directory
211+ continue ;
212+ }
213+
208214 if (ze .isDirectory ()) {
209- File f = projectFile ( context , ze .getName ());
210215 if ( !f .isDirectory ()) {
211216 f .mkdirs ();
212217 }
213218 } else {
214- FileOutputStream fout = new FileOutputStream ( projectFile ( context , ze . getName ()) );
219+ FileOutputStream fout = new FileOutputStream (f );
215220 BufferedOutputStream bufout = new BufferedOutputStream (fout );
216221 byte [] buffer = new byte [1024 ];
217222 int read = 0 ;
You can’t perform that action at this time.
0 commit comments