]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: log: ensure that unique_id is properly initialized
authorWilly Tarreau <w@1wt.eu>
Tue, 8 May 2012 13:51:44 +0000 (15:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 May 2012 19:28:16 +0000 (21:28 +0200)
Last memory poisonning patch immediately made this issue appear.
The unique_id field is released but not properly initialized. The
feature was introduced very recently, no backport is needed.

src/peers.c
src/session.c

index 182d71d23e2ef2d8e5b620b99e4da72afb8d8fe7..42018e13fea7319ad774138c4bc20d6f38a3ee18 100644 (file)
@@ -1204,6 +1204,7 @@ static struct session *peer_session_create(struct peer *peer, struct peer_sessio
        s->srv_error = default_srv_error;
 
        s->uniq_id = 0;
+       s->unique_id = NULL;
 
        txn = &s->txn;
        /* Those variables will be checked and freed if non-NULL in
index 862af58530cf24e7d7f8bee936cfc1c66b38a0ec..cd02da24d43dbd4ee3530f82d78555864db82521 100644 (file)
@@ -97,6 +97,7 @@ int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr)
        LIST_ADDQ(&sessions, &s->list);
        LIST_INIT(&s->back_refs);
 
+       s->unique_id = NULL;
        s->term_trace = 0;
        s->si[0].addr.from = *addr;
        s->logs.accept_date = date; /* user-visible date for logging */