BUG/MINOR: peers: Do not ignore a protocol error for dictionary entries.
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 12 Nov 2020 18:53:11 +0000 (19:53 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 Nov 2020 15:33:18 +0000 (16:33 +0100)
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 <cfaulet@haproxy.com>

src/peers.c

index aac015a..53c3c73 100644 (file)
@@ -1506,8 +1506,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;
                        }