From 406b1ab8cbd6974208c54122b033b6ce5f0be253 Mon Sep 17 00:00:00 2001 From: jsg Date: Sat, 10 Feb 2024 07:10:13 +0000 Subject: [PATCH] fix off-by-one when printing fr_arg found by "buffer overflow 'fp64->fr_arg' 6 <= 6" smatch error ok miod@ claudio@ --- sys/arch/sparc64/sparc64/machdep.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 4b4466fa57b..3e8de4190a7 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.207 2023/03/08 04:43:07 guenther Exp $ */ +/* $OpenBSD: machdep.c,v 1.208 2024/02/10 07:10:13 jsg Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -862,7 +862,7 @@ stackdump(void) printf("Frame pointer is at %p\n", fp64); printf("Call traceback:\n"); while (fp64 && ((u_long)fp64 >> PGSHIFT) == ((u_long)sfp >> PGSHIFT)) { - printf("%llx(%llx, %llx, %llx, %llx, %llx, %llx, %llx) " + printf("%llx(%llx, %llx, %llx, %llx, %llx, %llx) " "fp = %llx\n", (unsigned long long)fp64->fr_pc, (unsigned long long)fp64->fr_arg[0], @@ -871,7 +871,6 @@ stackdump(void) (unsigned long long)fp64->fr_arg[3], (unsigned long long)fp64->fr_arg[4], (unsigned long long)fp64->fr_arg[5], - (unsigned long long)fp64->fr_arg[6], (unsigned long long)fp64->fr_fp); fp64 = v9next_frame(fp64); } -- 2.20.1