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