authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-05 16:36:55-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-05 19:57:00-07:00
logd711f459ae1b73f7a1e6e6b596c1aff3066ecc29
treebc90be355b42785df88810474a9289e06b0615ee
parentb3e495a38a5e334f5e30e255592f810e0017919c

std.crypto.tls.Client: fix crash in read()

An abstraction for giving bytes to the read buffer didn't check for an out-of-space condition.

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

lib/std/crypto/tls/Client.zig+1
......@@ -1207,6 +1207,7 @@ const VecPut = struct {
12071207 /// Returns the amount actually put which is always equal to bytes.len
12081208 /// unless the vectors ran out of space.
12091209 fn put(vp: *VecPut, bytes: []const u8) usize {
1210 if (vp.idx >= vp.iovecs.len) return 0;
12101211 var bytes_i: usize = 0;
12111212 while (true) {
12121213 const v = vp.iovecs[vp.idx];