Skip to content

Commit 4d65309

Browse files
committed
Do not store buffer on the stack in GetProcAddress hook
1 parent 9ea7e9a commit 4d65309

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/hooks.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ fn redirectInit(
192192
// However, using handle seems to cause issues on some distros, so we pass
193193
// the resolved symbol instead.
194194
// TODO: document specific cases
195-
var buf: util.paths.ModulePathBuf = undefined;
195+
var buf = alloc.create(util.paths.ModulePathBuf) catch @panic("Out of memory");
196+
defer alloc.destroy(buf);
196197
const path = buf.get(switch (builtin.os.tag) {
197198
.windows => handle,
198199
else => std.c.dlsym(handle, name),

0 commit comments

Comments
 (0)