mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 14:51:27 +02:00
BUG/MINOR: http_ana: Be sure to have an allocated buffer to generate an error
In http_reply_and_close() and http_server_error(), we must be sure to have an allocated buffer (buf.size > 0) to consider it as a valid HTX message. For now, there is no way to hit this bug. But a fix to support "empty" error messages in HTX is pending. Such empty messages, after parsing, will be converted into unallocated buffer (buf.size == 0). This patch must be backported to 2.0 and 1.9. owever, the patch will have to be adapted.
This commit is contained in:
parent
ef91c939f3
commit
9f5839cde2
@ -4845,7 +4845,7 @@ void http_server_error(struct stream *s, struct stream_interface *si, int err,
|
|||||||
|
|
||||||
/* <msg> is an HTX structure. So we copy it in the response's
|
/* <msg> is an HTX structure. So we copy it in the response's
|
||||||
* channel */
|
* channel */
|
||||||
if (msg) {
|
if (msg && !b_is_null(msg)) {
|
||||||
struct channel *chn = si_ic(si);
|
struct channel *chn = si_ic(si);
|
||||||
struct htx *htx;
|
struct htx *htx;
|
||||||
|
|
||||||
@ -4875,7 +4875,7 @@ void http_reply_and_close(struct stream *s, short status, struct buffer *msg)
|
|||||||
/* <msg> is an HTX structure. So we copy it in the response's
|
/* <msg> is an HTX structure. So we copy it in the response's
|
||||||
* channel */
|
* channel */
|
||||||
/* FIXME: It is a problem for now if there is some outgoing data */
|
/* FIXME: It is a problem for now if there is some outgoing data */
|
||||||
if (msg) {
|
if (msg && !b_is_null(msg)) {
|
||||||
struct channel *chn = &s->res;
|
struct channel *chn = &s->res;
|
||||||
struct htx *htx;
|
struct htx *htx;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user