Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Only allow file name for EXPORT intent
Browse files Browse the repository at this point in the history
Allowing a file name for the IMPORT intent is a security risk

Refs #1784
  • Loading branch information
M66B committed Jul 4, 2014
1 parent 6ebe44c commit 3d31c0d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/biz/bokhorst/xprivacy/ActivityShare.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class ActivityShare extends ActivityBase {
private boolean mAbort = false;
private int mProgressCurrent;
private int mProgressWidth = 0;
private String mFileName;
private String mFileName = null;
private boolean mInteractive = false;

private static final int STATE_WAITING = 0;
Expand Down Expand Up @@ -153,7 +153,8 @@ protected void onCreate(Bundle savedInstanceState) {
final int[] uids = (extras != null && extras.containsKey(cUidList) ? extras.getIntArray(cUidList) : new int[0]);
final String restrictionName = (extras != null ? extras.getString(cRestriction) : null);
int choice = (extras != null && extras.containsKey(cChoice) ? extras.getInt(cChoice) : -1);
mFileName = (extras != null && extras.containsKey(cFileName) ? extras.getString(cFileName) : null);
if (action.equals(ACTION_EXPORT))
mFileName = (extras != null && extras.containsKey(cFileName) ? extras.getString(cFileName) : null);

// License check
if (action.equals(ACTION_IMPORT) || action.equals(ACTION_EXPORT)
Expand Down

0 comments on commit 3d31c0d

Please sign in to comment.