]> granicus.if.org Git - strace/commitdiff
nlattr: fix off-by-one error in indexed xlat lookup
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 23 Dec 2018 22:12:36 +0000 (22:12 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 23 Dec 2018 22:12:36 +0000 (22:12 +0000)
* 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"
nlattr.c

index d0884685ff9f81190b61dbc708c5eae4479e589e..f3df7d9984c2ccdd16a667eb0e58fa7f31b0d834 100644 (file)
--- 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;