summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-02-14 19:03:51 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-02-14 19:03:51 +0000
commit40ef7e1b553317342e24ed64d1b20aa7a2796e7b (patch)
tree67455429e82658ec5f745230c1d115dda500ef13 /sys
parent48e0419748d350d5519d688dd5480e19d99bc5c4 (diff)
Make spstrcpy() return ENAMETOOLONG if the string being copied is too long.
ok miod@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/hppa/genassym.cf3
-rw-r--r--sys/arch/hppa/hppa/locore.S10
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/arch/hppa/hppa/genassym.cf b/sys/arch/hppa/hppa/genassym.cf
index dab3e08efc2..aaa4058315c 100644
--- a/sys/arch/hppa/hppa/genassym.cf
+++ b/sys/arch/hppa/hppa/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.31 2007/10/10 15:53:51 art Exp $
+# $OpenBSD: genassym.cf,v 1.32 2009/02/14 19:03:50 kettenis Exp $
#
# Copyright (c) 1982, 1990, 1993
@@ -168,3 +168,4 @@ export SYS_sigreturn
# errno
export EFAULT
+export ENAMETOOLONG
diff --git a/sys/arch/hppa/hppa/locore.S b/sys/arch/hppa/hppa/locore.S
index c4c75675c11..217add80e3c 100644
--- a/sys/arch/hppa/hppa/locore.S
+++ b/sys/arch/hppa/hppa/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.159 2009/02/08 18:33:29 miod Exp $ */
+/* $OpenBSD: locore.S,v 1.160 2009/02/14 19:03:50 kettenis Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -2727,13 +2727,15 @@ LEAF_ENTRY(spstrcpy)
mtsp arg0, sr1
mtsp arg2, sr2
copy arg1, arg0
+ copy r0, ret0
$spstrcpy_loop
ldbs,ma 1(sr1, arg1), t1
- comb,= t2, arg1, $spstrcpy_exit
+ comb,= r0, t1, $spstrcpy_exit
stbs,ma t1, 1(sr2, arg3)
- comb,<>,n r0, t1, $spstrcpy_loop
+ comb,<>,n t2, arg1, $spstrcpy_loop
nop
+ ldi ENAMETOOLONG, ret0
$spstrcpy_exit
mtsp r0, sr1
@@ -2746,7 +2748,7 @@ $spstrcpy_exit
sub,= r0, arg0, r0
stw arg1, 0(arg0)
bv 0(rp)
- copy r0, ret0
+ nop
EXIT(spstrcpy)
/*