| ... | ... | @@ -15,6 +15,8 @@ const FEXTRA = 1 << 2; |
| 15 | 15 | const FNAME = 1 << 3; |
| 16 | 16 | const FCOMMENT = 1 << 4; |
| 17 | 17 | |
| 18 | const max_string_len = 1024; |
| 19 | |
| 18 | 20 | pub fn GzipStream(comptime ReaderType: type) type { |
| 19 | 21 | return struct { |
| 20 | 22 | const Self = @This(); |
| ... | ... | @@ -71,7 +73,7 @@ pub fn GzipStream(comptime ReaderType: type) type { |
| 71 | 73 | filename = try source.readUntilDelimiterAlloc( |
| 72 | 74 | allocator, |
| 73 | 75 | 0, |
| 74 | | std.math.maxInt(usize), |
| 76 | max_string_len, |
| 75 | 77 | ); |
| 76 | 78 | } |
| 77 | 79 | errdefer if (filename) |p| allocator.free(p); |
| ... | ... | @@ -81,7 +83,7 @@ pub fn GzipStream(comptime ReaderType: type) type { |
| 81 | 83 | comment = try source.readUntilDelimiterAlloc( |
| 82 | 84 | allocator, |
| 83 | 85 | 0, |
| 84 | | std.math.maxInt(usize), |
| 86 | max_string_len, |
| 85 | 87 | ); |
| 86 | 88 | } |
| 87 | 89 | errdefer if (comment) |p| allocator.free(p); |