]> git.kaiwu.me - haproxy.git/commit
[CRITICAL] uninitialized response field can sometimes cause crashes
authorWilly Tarreau <w@1wt.eu>
Mon, 27 Apr 2009 06:11:33 +0000 (08:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 10 May 2009 16:19:22 +0000 (18:19 +0200)
commit1aa71039ede2afd5dc9a727db01f9bda7db47b24
tree33f252cb6151866866e04bb16f0972ba76841043
parentd8b199849f1813a8420f1310549921814318a1a7
[CRITICAL] uninitialized response field can sometimes cause crashes

The response message in the transaction structure was not properly
initialised at session initialisation. In theory it cannot cause any
trouble since the affected field os expected to always remain NULL.
However, in some circumstances, such as building on 64-bit platforms
with certain options, the struct session can be exactly 1024 bytes,
the same size of the requri field, so the pools are merged and the
uninitialised field may contain non-null data, causing crashes if
an invalid response is encountered and archived.

The fix simply consists in correctly initialising the missing fields.
This bug cannot affect architectures where the session pool is not
shared (32-bit architectures), but this is only by pure luck.
(cherry-picked from commit 79e998919660b2ec6d5dc11be9d820c5c1965460)
(cherry picked from commit c0e4eb7d1dc3636757232ce730cbc9a8f6ac34d8)
src/client.c