1
0
mirror of http://git.haproxy.org/git/haproxy.git/ synced 2025-04-10 19:21:37 +00:00

BUG/MINOR: http: base32+src should use the big endian version of base32

We're using the internal memory representation of base32 here, which is
wrong since these data might be exported to headers for logs or be used
to stick to a server and replicated to other peers. Let's convert base32
to big endian (network representation) when building the binary block.

This mistake is also present in 1.5, it would be better to backport it.
This commit is contained in:
Willy Tarreau 2014-07-15 21:34:06 +02:00
parent edee1d60b7
commit 5ad6e1dc09

View File

@ -10358,8 +10358,8 @@ smp_fetch_base32_src(struct proxy *px, struct session *l4, void *l7, unsigned in
return 0;
temp = get_trash_chunk();
memcpy(temp->str + temp->len, &smp->data.uint, sizeof(smp->data.uint));
temp->len += sizeof(smp->data.uint);
*(unsigned int *)temp->str = htonl(smp->data.uint);
temp->len += sizeof(unsigned int);
switch (cli_conn->addr.from.ss_family) {
case AF_INET: