mirror of
https://github.com/ziglang/zig.git
synced 2025-12-08 23:33:07 +00:00
std.crypto.tls.Client: fix infinite loop in std.Io.Writer.writeAll
This commit is contained in:
parent
df712d0833
commit
07b6dbf8ca
@ -942,7 +942,6 @@ fn drain(w: *Writer, data: []const []const u8, splat: usize) Writer.Error!usize
|
|||||||
if (prepared.cleartext_len < buf.len) break :done;
|
if (prepared.cleartext_len < buf.len) break :done;
|
||||||
}
|
}
|
||||||
for (data[0 .. data.len - 1]) |buf| {
|
for (data[0 .. data.len - 1]) |buf| {
|
||||||
if (buf.len < min_buffer_len) break :done;
|
|
||||||
const prepared = prepareCiphertextRecord(c, ciphertext_buf[ciphertext_end..], buf, .application_data);
|
const prepared = prepareCiphertextRecord(c, ciphertext_buf[ciphertext_end..], buf, .application_data);
|
||||||
total_clear += prepared.cleartext_len;
|
total_clear += prepared.cleartext_len;
|
||||||
ciphertext_end += prepared.ciphertext_end;
|
ciphertext_end += prepared.ciphertext_end;
|
||||||
@ -950,7 +949,6 @@ fn drain(w: *Writer, data: []const []const u8, splat: usize) Writer.Error!usize
|
|||||||
}
|
}
|
||||||
const buf = data[data.len - 1];
|
const buf = data[data.len - 1];
|
||||||
for (0..splat) |_| {
|
for (0..splat) |_| {
|
||||||
if (buf.len < min_buffer_len) break :done;
|
|
||||||
const prepared = prepareCiphertextRecord(c, ciphertext_buf[ciphertext_end..], buf, .application_data);
|
const prepared = prepareCiphertextRecord(c, ciphertext_buf[ciphertext_end..], buf, .application_data);
|
||||||
total_clear += prepared.cleartext_len;
|
total_clear += prepared.cleartext_len;
|
||||||
ciphertext_end += prepared.ciphertext_end;
|
ciphertext_end += prepared.ciphertext_end;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user