diff options
| author | Carl Åstholm <carl@astholm.se> | 2024-01-07 21:39:22 +0100 |
|---|---|---|
| committer | Carl Åstholm <carl@astholm.se> | 2024-01-07 21:46:52 +0100 |
| commit | 01b48e938198a206b95ed06f3a7e530e859c1cbc (patch) | |
| tree | 7d931f5f08e2db834fec364a01774c89b8cdbcc1 /src/InternPool.zig | |
| parent | 92458094c8f8294d7bb50d28b09dd2c02b03a25e (diff) | |
| download | zig-01b48e938198a206b95ed06f3a7e530e859c1cbc.tar.gz zig-01b48e938198a206b95ed06f3a7e530e859c1cbc.zip | |
InternPool: Fix rare buffer overflow when initializing aggregate with sentinel
Diffstat (limited to 'src/InternPool.zig')
| -rw-r--r-- | src/InternPool.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index 2e690652a3..0844e0f7a5 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -5315,7 +5315,7 @@ pub fn get(ip: *InternPool, gpa: Allocator, key: Key) Allocator.Error!Index { try ip.extra.ensureUnusedCapacity( gpa, - @typeInfo(Tag.Aggregate).Struct.fields.len + @as(usize, @intCast(len_including_sentinel)), + @typeInfo(Tag.Aggregate).Struct.fields.len + @as(usize, @intCast(len_including_sentinel + 1)), ); ip.items.appendAssumeCapacity(.{ .tag = .aggregate, |
