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



commit e0c35c6df23e26d3fe16da9bd8d6d8a9f04dad51
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 d5288a757..586fe287f 100644
--- a/vala/valaclass.vala
+++ b/vala/valaclass.vala
@@ -454,7 +454,8 @@ public class Vala.Class : ObjectTypeSymbol {
                }
 
                foreach (DataType base_type in base_types) {
-                       if (base_type.type_symbol != null && base_type.type_symbol.is_subtype_of (t)) {
+                       if (base_type.type_symbol != null && base_type.type_symbol != this
+                           && base_type.type_symbol.is_subtype_of (t)) {
                                return true;
                        }
                }


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