Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bc601d5 authored by Jeff Vander Stoep's avatar Jeff Vander Stoep Committed by Jeffrey Vander Stoep
Browse files

Sanity-check paths of files to be restored

(cherry picked from commit 7d51cc701a6735cf455af8479f56c9c0b2109e02)
Bug: 16298491
Change-Id: I0c2d6523c9d152dad4d27d06d3853afd432e5af7
parent 60f22fbf
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3390,6 +3390,14 @@ class BackupManagerService extends IBackupManager.Stub {
                                break;
                        }

                        // The path needs to be canonical
                        if (info.path.contains("..") || info.path.contains("//")) {
                            if (MORE_DEBUG) {
                                Slog.w(TAG, "Dropping invalid path " + info.path);
                            }
                            okay = false;
                        }

                        // If the policy is satisfied, go ahead and set up to pipe the
                        // data to the agent.
                        if (DEBUG && okay && mAgent != null) {