]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: Wrong type used as argument for spoe_decode_buffer().
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 22 Aug 2017 08:33:14 +0000 (10:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Aug 2017 09:27:20 +0000 (11:27 +0200)
commit6ca71a9297b0f9e5a59b8adf3bc8204de5c308a4
treeffb4c92520b6325171fa0a1c5abc0c487f6770d7
parenta5480694bfdff33e6327573cd7a97ff112ea4806
BUG/MINOR: Wrong type used as argument for spoe_decode_buffer().

Contrary to 64-bits libCs where size_t type size is 8, on systems with 32-bits
size of size_t is 4 (the size of a long) which does not equal to size of uint64_t type.
This was revealed by such GCC warnings on 32bits systems:

src/flt_spoe.c:2259:40: warning: passing argument 4 of spoe_decode_buffer from
incompatible pointer type
  if (spoe_decode_buffer(&p, end, &str, &sz) == -1)
                                         ^
As the already existing code using spoe_decode_buffer() already use such pointers to
uint64_t, in place of pointer to size_t ;), most of this code is in contrib directory,
this simple patch modifies the prototype of spoe_decode_buffer() so that to use a
pointer to uint64_t in place of a pointer to size_t, uint64_t type being the type
finally required for decode_varint().
include/proto/spoe.h
src/flt_spoe.c