From 18195c558d77ae1b6779cbf3c144739663837e70 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 1 Jul 2022 15:27:42 -0500 Subject: [PATCH] lsteamclient: Also don't cache interfaces with vtable allocated from steamclient.dll. CW-Bug-Id: #20909 --- lsteamclient/steamclient_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lsteamclient/steamclient_main.c b/lsteamclient/steamclient_main.c index 0a360ac3..88dbab3b 100644 --- a/lsteamclient/steamclient_main.c +++ b/lsteamclient/steamclient_main.c @@ -615,8 +615,14 @@ void *create_win_interface(const char *name, void *linux_side) if (!strcmp(name, constructors[i].iface_version)) { ret = constructors[i].ctor(linux_side); - if (allocated_from_steamclient_dll(ret)) + if (allocated_from_steamclient_dll(ret) + || allocated_from_steamclient_dll(*(void **)ret) /* vtable */) + { + /* Don't cache interfaces allocated from steamclient.dll space. + * steamclient may get reloaded by the app, miss the previous + * data and potentially have different load address. */ break; + } e = HeapAlloc(GetProcessHeap(), 0, sizeof(*e)); e->name = constructors[i].iface_version;