summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUrs Grob <ursg@google.com>2009-04-28 18:20:31 +0200
committerUrs Grob <ursg@google.com>2009-04-28 18:41:47 +0200
commit41b540c3e8dfdf494314c0afe7cf5b228fa281ed (patch)
treef95afd02665288991f283383800ebc4d35adf1ad
parent64c59d08c125b04d766d4af0c2af8fe2a74919b5 (diff)
downloadlibcore-41b540c3e8dfdf494314c0afe7cf5b228fa281ed.zip
libcore-41b540c3e8dfdf494314c0afe7cf5b228fa281ed.tar.gz
libcore-41b540c3e8dfdf494314c0afe7cf5b228fa281ed.tar.bz2
Fix an infinite loop in ClassLoader.isAncestorOf()
The current version loops endlessly if the callers ClassLoader is not the same as the system ClassLoader. The cause for this is a loop variable that is not changed during the loop. BUG=1732214
-rw-r--r--luni-kernel/src/main/java/java/lang/ClassLoader.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/luni-kernel/src/main/java/java/lang/ClassLoader.java b/luni-kernel/src/main/java/java/lang/ClassLoader.java
index 822fade..3c2e911 100644
--- a/luni-kernel/src/main/java/java/lang/ClassLoader.java
+++ b/luni-kernel/src/main/java/java/lang/ClassLoader.java
@@ -634,7 +634,7 @@ public abstract class ClassLoader {
*/
final boolean isAncestorOf(ClassLoader child) {
for (ClassLoader current = child; current != null;
- current = child.parent) {
+ current = current.parent) {
if (current == this) {
return true;
}