From 2a3b82eb8a14160d7dc1294b66ffcb961148ada7 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Mon, 19 Jun 2017 13:04:16 +0200 Subject: fix stackoverflow case by limiting the depth of search to 10 --- .../main/java/com/zeapo/pwdstore/autofill/AutofillService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/src') 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(); } -- cgit v1.2.3