From 715a80c129ef6e2e0cc8adda1511e32c4926bf33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Thu, 12 Nov 2020 19:53:11 +0100 Subject: [PATCH] BUG/MINOR: peers: Do not ignore a protocol error for dictionary entries. If we could not decode the ID of a dictionary entry from a peer update message, we must inform the remote peer about such an error as this is done for any other decoding error. (cherry picked from commit f9e51beec118f1bbd558ed689fdad35046160529) Signed-off-by: Christopher Faulet (cherry picked from commit cd24d5cfbe58bf2b25a76d077a0923053cbf7838) Signed-off-by: Christopher Faulet (cherry picked from commit c4b0ea55b105ae65d9580e7b915460645f0be2fa) Signed-off-by: Christopher Faulet --- src/peers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/peers.c b/src/peers.c index fb7f80f..c05a96e 100644 --- a/src/peers.c +++ b/src/peers.c @@ -1511,8 +1511,9 @@ static int peer_treat_updatemsg(struct appctx *appctx, struct peer *p, int updt, dc = p->dcache; if (*msg_cur == end) { /* Dictionary entry key without value. */ - if (id > dc->max_entries) - break; + if (id > dc->max_entries) { + goto malformed_unlock; + } /* IDs sent over the network are numbered from 1. */ de = dc->rx[id - 1].de; } -- 1.7.10.4