]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: grpc: Fix several unaligned 32/64 bits accesses
authorFrederic Lecaille <flecaille@haproxy.com>
Mon, 15 Apr 2024 07:57:37 +0000 (09:57 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Tue, 16 Apr 2024 05:37:28 +0000 (07:37 +0200)
commit98583c42560a082c9d9898ba9e35cbd68ad15815
tree12b2235cff71aed087c5821d7ad4c81b3fabc44f
parent153fac480480d2eb6001f3180622853bbd2d71a7
BUG/MEDIUM: grpc: Fix several unaligned 32/64 bits accesses

There were several places in grpc and its dependency protobuf where unaligned
accesses were done. Read accesses to 32 (resp. 64) bits values should be performed
by read_u32() (resp. read_u64()).
Replace these unligned read accesses by correct calls to these functions.
Same fixes for doubles and floats.

Such unaligned read accesses could lead to crashes with bus errors on CPU
archictectures which do not fix them at run time.

This patch depends on this previous commit:
    861199fa71 MINOR: net_helper: Add support for floats/doubles.

Must be backported as far as 2.6.
include/haproxy/protobuf.h
src/sample.c