]> granicus.if.org Git - strace/commitdiff
netlink_smc_diag: fix off-by-one error in 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)
* netlink_smc_diag.c (decode_smc_diag_shutdown): Decrement xlat size
by one to account for XLAT_END as other users of xlats do.

Fixes: v4.25~54 "netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value"
netlink_smc_diag.c

index 883378298c436d2c5e377f648ae8021a5eefbf2a..25809fc8d743f7ce14f46ef1cc554c3572bd4ab4 100644 (file)
@@ -136,7 +136,7 @@ decode_smc_diag_shutdown(struct tcb *const tcp,
                         const void *const opaque_data)
 {
        const struct decode_nla_xlat_opts opts = {
-               ARRSZ_PAIR(sock_shutdown_flags), "???_SHUTDOWN",
+               ARRSZ_PAIR(sock_shutdown_flags) - 1, "???_SHUTDOWN",
                .size = 1,
        };