aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamed <mohamed@zenadi.com>2017-06-19 13:04:16 +0200
committerMohamed <mohamed@zenadi.com>2017-06-19 13:04:16 +0200
commit2a3b82eb8a14160d7dc1294b66ffcb961148ada7 (patch)
tree760093f3d2e296fd30ff22f711a90369fcef52e1
parent72e441aafe03e88e6abafe2e2c8464859ac62d95 (diff)
fix stackoverflow case by limiting the depth of search to 10
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java
index cb8459d5..405f163b 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java
@@ -221,8 +221,11 @@ public class AutofillService extends AccessibilityService {
}
showDialog(packageName, appName, isWeb);
}
-
private String searchWebView(AccessibilityNodeInfo source) {
+ return searchWebView(source, 10);
+ }
+
+ private String searchWebView(AccessibilityNodeInfo source, int depth) {
if (source == null) {
return null;
}
@@ -237,8 +240,9 @@ public class AutofillService extends AccessibilityService {
}
return "";
}
- if (searchWebView(u) != null) {
- return searchWebView(u);
+ String webView = searchWebView(u, depth - 1);
+ if (webView != null) {
+ return webView;
}
u.recycle();
}