Commit d29ed2a785

daurnimator <quae@daurnimator.com>
2020-04-13 17:24:18
std: fix StreamSource to disallow writing to a const buffer
1 parent b702964
Changed files (1)
lib/std/io/stream_source.zig
@@ -39,7 +39,7 @@ pub const StreamSource = union(enum) {
     pub fn write(self: *StreamSource, bytes: []const u8) WriteError!usize {
         switch (self.*) {
             .buffer => |*x| return x.write(bytes),
-            .const_buffer => |*x| return x.write(bytes),
+            .const_buffer => return error.AccessDenied,
             .file => |x| return x.write(bytes),
         }
     }