[vala/0.40] vala: Prevent possible stack-overflow in Class.is_subtype_of()



commit 73780121c7e92c55f4008c3225115b729d6f81ff
Author: Princeton Ferro <princetonferro gmail com>
Date:   Tue Feb 18 10:39:54 2020 +0100

    vala: Prevent possible stack-overflow in Class.is_subtype_of()

 vala/valaclass.vala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/vala/valaclass.vala b/vala/valaclass.vala
index 1a0f1d551..532acc19d 100644
--- a/vala/valaclass.vala
+++ b/vala/valaclass.vala
@@ -434,7 +434,8 @@ public class Vala.Class : ObjectTypeSymbol {
                }
 
                foreach (DataType base_type in base_types) {
-                       if (base_type.data_type != null && base_type.data_type.is_subtype_of (t)) {
+                       if (base_type.data_type != null && base_type.data_type != this
+                           && base_type.data_type.is_subtype_of (t)) {
                                return true;
                        }
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]