summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Heider <tobhe@cvs.openbsd.org>2022-01-20 14:02:52 +0000
committerTobias Heider <tobhe@cvs.openbsd.org>2022-01-20 14:02:52 +0000
commitd522209291e467a8919839e58477248b9619ed66 (patch)
tree81c03b8108cde951b1472c9643bbe594f213a6ff
parenta9bfd0fecdba9fb622faca806aa9130a8de6e0d2 (diff)
Don't return uninitialized stack memory on copyin() error.
Found with clang static analyzer. ok gkoehler@
-rw-r--r--sys/arch/powerpc/powerpc/trap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c
index 5831bc1cf7e..6e12ceb4ee4 100644
--- a/sys/arch/powerpc/powerpc/trap.c
+++ b/sys/arch/powerpc/powerpc/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.123 2021/12/09 00:26:11 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.124 2022/01/20 14:02:51 tobhe Exp $ */
/* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */
/*
@@ -419,10 +419,10 @@ trap(struct trapframe *frame)
/* nothing to do */
break;
default:
+ frame->fixreg[FIRSTARG + 1] = rval[1];
bad:
frame->fixreg[0] = error;
frame->fixreg[FIRSTARG] = error;
- frame->fixreg[FIRSTARG + 1] = rval[1];
frame->cr |= 0x10000000;
break;
}