Skip to content

Commit 07b6dbf

Browse files
marximimusandrewrk
authored andcommitted
std.crypto.tls.Client: fix infinite loop in std.Io.Writer.writeAll
1 parent df712d0 commit 07b6dbf

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

lib/std/crypto/tls/Client.zig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,15 +942,13 @@ fn drain(w: *Writer, data: []const []const u8, splat: usize) Writer.Error!usize
942942
if (prepared.cleartext_len < buf.len) break :done;
943943
}
944944
for (data[0 .. data.len - 1]) |buf| {
945-
if (buf.len < min_buffer_len) break :done;
946945
const prepared = prepareCiphertextRecord(c, ciphertext_buf[ciphertext_end..], buf, .application_data);
947946
total_clear += prepared.cleartext_len;
948947
ciphertext_end += prepared.ciphertext_end;
949948
if (prepared.cleartext_len < buf.len) break :done;
950949
}
951950
const buf = data[data.len - 1];
952951
for (0..splat) |_| {
953-
if (buf.len < min_buffer_len) break :done;
954952
const prepared = prepareCiphertextRecord(c, ciphertext_buf[ciphertext_end..], buf, .application_data);
955953
total_clear += prepared.cleartext_len;
956954
ciphertext_end += prepared.ciphertext_end;

0 commit comments

Comments
 (0)