From be72b4033a3d437c20e132d441ae6047ba8d1bdb Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Thu, 14 Mar 2019 21:13:03 -0400 Subject: [PATCH] shims: Prevent a potential stack overflow in the client shims. --- tests/examples/shims/client.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/examples/shims/client.lua b/tests/examples/shims/client.lua index 54b0df35..d4bddd78 100644 --- a/tests/examples/shims/client.lua +++ b/tests/examples/shims/client.lua @@ -33,6 +33,12 @@ function client.gen_fake(args) ret.icon_sizes = {{16,16}} ret.name = "Example Client" + -- This is a hack because there's a `:is_transient_for(c2)` method + -- and a `transient_for` property. It will cause a stack overflow + -- since the auto-alias will kick in if the property is allowed to + -- be `nil`. + ret.transient_for = false + -- Apply all properties for k,v in pairs(args or {}) do ret[k] = v