]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: session: risk of crash on out of memory conditions
authorWilly Tarreau <w@1wt.eu>
Sun, 20 Oct 2013 21:10:28 +0000 (23:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Oct 2013 06:59:03 +0000 (07:59 +0100)
commit05bf5e1c36194b62e963c422498070a545c2f555
tree239a78bb4aebd6742ce3fe43cce897bca09359b2
parenta054d410db7e3498b66181c0f29cdbf0dd08a532
BUG/MEDIUM: session: risk of crash on out of memory conditions

In session_accept(), if we face a memory allocation error, we try to
emit an HTTP 500 error message in HTTP mode. The problem is that we
must not use http_error_message() for this since it dereferences the
session which can be NULL in this case.

We don't need the session to build the error message anyway since
this function only uses it to retrieve the backend and frontend to
get the most suited error message. Let's pick it ourselves, we're
at the beginning of the session, only the frontend is relevant.

This bug is 1.5-specific.
src/session.c