From: Dmitry V. Levin Date: Sun, 23 Dec 2018 22:12:36 +0000 (+0000) Subject: nlattr: fix off-by-one error in indexed xlat lookup X-Git-Tag: v4.26~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2c63fa8973442747de715ff5ff5340383e7b69d;p=strace nlattr: fix off-by-one error in indexed xlat lookup * nlattr.c (decode_nla_meminfo): Decrement xlat size by one to account for XLAT_END as other users of indexed xlats do. Fixes: v4.23~89 "nlattr: print index names in netlink meminfo array" --- diff --git a/nlattr.c b/nlattr.c index d0884685..f3df7d99 100644 --- a/nlattr.c +++ b/nlattr.c @@ -198,7 +198,7 @@ decode_nla_meminfo(struct tcb *const tcp, tfetch_mem, print_uint32_array_member, &count, PAF_PRINT_INDICES | PAF_INDEX_XLAT_VALUE_INDEXED | XLAT_STYLE_FMT_U, - ARRSZ_PAIR(netlink_sk_meminfo_indices), + ARRSZ_PAIR(netlink_sk_meminfo_indices) - 1, "SK_MEMINFO_???"); return true;