]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: stream: Missing DNS context initializations.
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 23 Apr 2019 15:26:33 +0000 (17:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 23 Apr 2019 18:24:11 +0000 (20:24 +0200)
Fix some missing initializations wich came with 333939c commit (MINOR: action:
new '(http-request|tcp-request content) do-resolve' action). The DNS contexts of
streams which were allocated were not initialized by stream_new(). This leaded to
accesses to non-allocated memory when freeing these contexts with stream_free().

src/stream.c

index af15d47a1b9e3ce033153f7cbbe30bccf6c10bff..e1218e3772fa8a0ee49a16571dcc307b7b1e3a3e 100644 (file)
@@ -310,6 +310,11 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin)
        s->txn = NULL;
        s->hlua = NULL;
 
+       s->dns_ctx.dns_requester = NULL;
+       s->dns_ctx.hostname_dn = NULL;
+       s->dns_ctx.hostname_dn_len = 0;
+       s->dns_ctx.parent = NULL;
+
        HA_SPIN_LOCK(STRMS_LOCK, &streams_lock);
        LIST_ADDQ(&streams, &s->list);
        HA_SPIN_UNLOCK(STRMS_LOCK, &streams_lock);