Skip to content

Commit 01b48e9

Browse files
committed
InternPool: Fix rare buffer overflow when initializing aggregate with sentinel
1 parent 9245809 commit 01b48e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/InternPool.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5315,7 +5315,7 @@ pub fn get(ip: *InternPool, gpa: Allocator, key: Key) Allocator.Error!Index {
53155315

53165316
try ip.extra.ensureUnusedCapacity(
53175317
gpa,
5318-
@typeInfo(Tag.Aggregate).Struct.fields.len + @as(usize, @intCast(len_including_sentinel)),
5318+
@typeInfo(Tag.Aggregate).Struct.fields.len + @as(usize, @intCast(len_including_sentinel + 1)),
53195319
);
53205320
ip.items.appendAssumeCapacity(.{
53215321
.tag = .aggregate,

0 commit comments

Comments
 (0)