mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
BUG/MINOR: http: error snapshots are wrong if buffer wraps
Commit 81f2fb added support for wrapping buffer captures, but unfortunately the code used to perform two memcpy() over the same destination, causing a loss of the start of the buffer rendering some error snapshots unusable. This bug is present in 1.4 too and must be backported.
This commit is contained in:
parent
22bca61404
commit
d6c2e8c916
@ -7227,7 +7227,7 @@ void http_capture_bad_message(struct error_snapshot *es, struct session *s,
|
||||
es->len = bi_end(buf) - (buf->p + msg->som) + buf->size;
|
||||
memcpy(es->buf, buf->p + msg->som, MIN(len1, sizeof(es->buf)));
|
||||
if (es->len > len1 && len1 < sizeof(es->buf))
|
||||
memcpy(es->buf, buf->data, MIN(es->len, sizeof(es->buf)) - len1);
|
||||
memcpy(es->buf + len1, buf->data, MIN(es->len, sizeof(es->buf)) - len1);
|
||||
}
|
||||
else {
|
||||
es->len = bi_end(buf) - (buf->p + msg->som);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user