authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-07-10 04:27:23-06:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-07-23 13:54:24+03:00
log819c868bbf362ac869ff65a9632969f3bc1a749a
tree2f4c909ad40d0f13fc571b59ea8e04c615d03109
parent889efddd1a2b12d3348f06900436b9ba8c823a01

std.net.getAddressList: fix segfault on bad hostname

Fixes #12065

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/net.zig+1-1
...@@ -731,7 +731,7 @@ pub fn getAddressList(allocator: mem.Allocator, name: []const u8, port: u16) !*A...@@ -731,7 +731,7 @@ pub fn getAddressList(allocator: mem.Allocator, name: []const u8, port: u16) !*A
731 break :blk result;731 break :blk result;
732 };732 };
733 const arena = result.arena.allocator();733 const arena = result.arena.allocator();
734 errdefer result.arena.deinit();734 errdefer result.deinit();
735735
736 if (builtin.target.os.tag == .windows or builtin.link_libc) {736 if (builtin.target.os.tag == .windows or builtin.link_libc) {
737 const name_c = try std.cstr.addNullByte(allocator, name);737 const name_c = try std.cstr.addNullByte(allocator, name);