authorgravatar for 40419155+marximimus@users.noreply.github.commarximimus <40419155+marximimus@users.noreply.github.com> 2025-09-10 17:54:56+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-09 12:35:19-07:00
logca59ad658f25e0334e95a3044ca8813d0fff41c3
treedd3acd5d94813ba3c343e05c33aac6b18c33bc71
parent8ccca8472a06b7dfbe5478da86769056ee1604ee

std.crypto.tls.Client: fix infinite loop in std.Io.Writer.writeAll


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

lib/std/crypto/tls/Client.zig-2
...@@ -942,7 +942,6 @@ fn drain(w: *Writer, data: []const []const u8, splat: usize) Writer.Error!usize...@@ -942,7 +942,6 @@ fn drain(w: *Writer, data: []const []const u8, splat: usize) Writer.Error!usize
942 if (prepared.cleartext_len < buf.len) break :done;942 if (prepared.cleartext_len < buf.len) break :done;
943 }943 }
944 for (data[0 .. data.len - 1]) |buf| {944 for (data[0 .. data.len - 1]) |buf| {
945 if (buf.len < min_buffer_len) break :done;
946 const prepared = prepareCiphertextRecord(c, ciphertext_buf[ciphertext_end..], buf, .application_data);945 const prepared = prepareCiphertextRecord(c, ciphertext_buf[ciphertext_end..], buf, .application_data);
947 total_clear += prepared.cleartext_len;946 total_clear += prepared.cleartext_len;
948 ciphertext_end += prepared.ciphertext_end;947 ciphertext_end += prepared.ciphertext_end;
...@@ -950,7 +949,6 @@ fn drain(w: *Writer, data: []const []const u8, splat: usize) Writer.Error!usize...@@ -950,7 +949,6 @@ fn drain(w: *Writer, data: []const []const u8, splat: usize) Writer.Error!usize
950 }949 }
951 const buf = data[data.len - 1];950 const buf = data[data.len - 1];
952 for (0..splat) |_| {951 for (0..splat) |_| {
953 if (buf.len < min_buffer_len) break :done;
954 const prepared = prepareCiphertextRecord(c, ciphertext_buf[ciphertext_end..], buf, .application_data);952 const prepared = prepareCiphertextRecord(c, ciphertext_buf[ciphertext_end..], buf, .application_data);
955 total_clear += prepared.cleartext_len;953 total_clear += prepared.cleartext_len;
956 ciphertext_end += prepared.ciphertext_end;954 ciphertext_end += prepared.ciphertext_end;