mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
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.
This commit is contained in:
parent
b3e495a38a
commit
d711f459ae
@ -1207,6 +1207,7 @@ const VecPut = struct {
|
||||
/// Returns the amount actually put which is always equal to bytes.len
|
||||
/// unless the vectors ran out of space.
|
||||
fn put(vp: *VecPut, bytes: []const u8) usize {
|
||||
if (vp.idx >= vp.iovecs.len) return 0;
|
||||
var bytes_i: usize = 0;
|
||||
while (true) {
|
||||
const v = vp.iovecs[vp.idx];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user