Commit 17965eb
zlib: fix pointer alignment
The function AllocForBrotli prefixes the allocated memory with its
size, and returns a pointer to the region after it. This pointer can
however no longer be suitably aligned. Correct this by allocating
the maximum of the the size of the size_t and the max alignment.
On Arm 32bits the size_t is 4 bytes long, but the alignment is 8 for
some NEON instructions. When Brotli is compiled with optimizations
enabled newer GCC versions will use the NEON instructions and trigger
a bus error killing node.
see google/brotli#1159
PR-URL: #57727
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>1 parent 0bf2c28 commit 17965eb
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
611 | | - | |
| 611 | + | |
| 612 | + | |
612 | 613 | | |
613 | 614 | | |
614 | 615 | | |
| |||
617 | 618 | | |
618 | 619 | | |
619 | 620 | | |
620 | | - | |
| 621 | + | |
621 | 622 | | |
622 | 623 | | |
623 | 624 | | |
624 | 625 | | |
625 | 626 | | |
626 | 627 | | |
627 | 628 | | |
628 | | - | |
| 629 | + | |
| 630 | + | |
629 | 631 | | |
630 | 632 | | |
631 | 633 | | |
| |||
0 commit comments