memmove16 implementation is playing with fire #26

Closed
opened 2026-01-29 20:29:15 +00:00 by claunia · 1 comment
Owner

Originally created by @rygorous on GitHub (Sep 22, 2015).

As already noted in the code https://github.com/google/brotli/blob/master/dec/decode.c#L89, assuming details about the memcpy implementation and optimizations is playing with fire. Maybe introduce a BROTLI_NO_DANGEROUS_OPTIMIZATIONS #define that avoids this kind of code path, to ease porting to non-mainstream architectures?

Originally created by @rygorous on GitHub (Sep 22, 2015). As already noted in the code https://github.com/google/brotli/blob/master/dec/decode.c#L89, assuming details about the memcpy implementation and optimizations is playing with fire. Maybe introduce a BROTLI_NO_DANGEROUS_OPTIMIZATIONS #define that avoids this kind of code path, to ease porting to non-mainstream architectures?
Author
Owner

@eustas commented on GitHub (Sep 28, 2015):

Fixed with PR 183.
Compiling with -DBROTLI_BUILD_PORTABLE avoids overlapping memcpy and unaligned reads.

@eustas commented on GitHub (Sep 28, 2015): Fixed with PR 183. Compiling with -DBROTLI_BUILD_PORTABLE avoids overlapping memcpy and unaligned reads.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#26