# macho: fix incorrect segment/section growth calculation · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/affd8f8b59d9d803f98178ec32ab9e2f6b0b30d2)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: affd8f8b59d9d803f98178ec32ab9e2f6b0b30d2

Requested commit: affd8f8b59d9d803f98178ec32ab9e2f6b0b30d2

Commit: affd8f8b59d9d803f98178ec32ab9e2f6b0b30d2

Tree: 3a259023be3fd6454aa3d28433a75f2d03f8bc62

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
macho: fix incorrect segment/section growth calculation

Otherwise, for last sections in segments it could happen we would
not expand the segment when actually required thus exceeding the
segment's size and causing data clobbering and dyld runtime errors.

```

## Parents

- [a2dd0c387dd9e08c0147490b0667146758b6a43b](https://git.cafe/gitcafe/zig/commit/a2dd0c387dd9e08c0147490b0667146758b6a43b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/affd8f8b59d9d803f98178ec32ab9e2f6b0b30d2?format=markdown)
