macho: LC_RPATH: reserve byte for null-terminator

This commit is contained in:
Michael Dusan 2021-06-17 23:57:24 -04:00 committed by Jakub Konka
parent 1f29b75f08
commit e006281d79

View File

@ -2511,7 +2511,7 @@ fn addRpaths(self: *Zld, rpaths: []const []const u8) !void {
for (rpaths) |rpath| {
const cmdsize = @intCast(u32, mem.alignForwardGeneric(
u64,
@sizeOf(macho.rpath_command) + rpath.len,
@sizeOf(macho.rpath_command) + rpath.len + 1,
@sizeOf(u64),
));
var rpath_cmd = emptyGenericCommandWithData(macho.rpath_command{