From: Dmitry V. Levin Date: Sun, 23 Dec 2018 22:12:36 +0000 (+0000) Subject: net: fix off-by-one error in sorted xlat lookup X-Git-Tag: v4.26~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=476b03b33a9e4d0eb1a77fcb544c58b34d0e27b9;p=strace net: fix off-by-one error in sorted xlat lookup * net.c (ax25_protocols): Decrement xlat size by one to account for XLAT_END as other users of sorted xlats do. Fixes: v4.25~28 "net: add support for AX.25 protocols and socket option names decoding" --- diff --git a/net.c b/net.c index bcab3294..a87bdf74 100644 --- a/net.c +++ b/net.c @@ -128,8 +128,9 @@ SYS_FUNC(socket) case AF_AX25: /* Those are not available in public headers. */ - printxval_searchn_ex(ARRSZ_PAIR(ax25_protocols), tcp->u_arg[2], - "AX25_P_???", XLAT_STYLE_VERBOSE); + printxval_searchn_ex(ARRSZ_PAIR(ax25_protocols) - 1, + tcp->u_arg[2], "AX25_P_???", + XLAT_STYLE_VERBOSE); break; case AF_NETLINK: