about summary refs log tree commit diff
path: root/sysdeps/i386/strchr.S
diff options
context:
space:
mode:
authorGreg McGary <greg@mcgary.org>2000-06-26 22:15:00 +0000
committerGreg McGary <greg@mcgary.org>2000-06-26 22:15:00 +0000
commit2fc0882697f83d4ef8fe7090c66a27d9396095ba (patch)
tree3c5fbeca60aec00a55bdd6443735e2cd241f9c98 /sysdeps/i386/strchr.S
parentc2eee429d3cbb5e81b84bca109db19b119dbedc2 (diff)
downloadglibc-2fc0882697f83d4ef8fe7090c66a27d9396095ba.tar.gz
glibc-2fc0882697f83d4ef8fe7090c66a27d9396095ba.tar.xz
glibc-2fc0882697f83d4ef8fe7090c66a27d9396095ba.zip
* sysdeps/i386/add_n.S: Wrap entry-point symbol in BP_SYM ().
Check bounds of arguments. 
* sysdeps/i386/addmul_1.S: Likewise. 
* sysdeps/i386/lshift.S: Likewise. 
* sysdeps/i386/mul_1.S: Likewise. 
* sysdeps/i386/rshift.S: Likewise. 
* sysdeps/i386/sub_n.S: Likewise. 
* sysdeps/i386/submul_1.S: Likewise. 
* sysdeps/i386/i586/add_n.S: Likewise. 
* sysdeps/i386/i586/addmul_1.S: Likewise. 
* sysdeps/i386/i586/lshift.S: Likewise. 
* sysdeps/i386/i586/rshift.S: Likewise. 
* sysdeps/i386/i586/sub_n.S: Likewise. 
* sysdeps/i386/i686/add_n.S: Likewise.
	* sysdeps/i386/memchr.S: Likewise.
	* sysdeps/i386/memcmp.S: Likewise.
	* sysdeps/i386/rawmemchr.S: Likewise.
	* sysdeps/i386/i586/bzero.S: Likewise.
	* sysdeps/i386/i586/memcpy.S: Likewise.
	* sysdeps/i386/i586/mempcpy.S: Likewise.
	* sysdeps/i386/i586/memset.S: Likewise.
	* sysdeps/i386/i686/bzero.S: Likewise.
	* sysdeps/i386/i686/memcpy.S: Likewise.
	* sysdeps/i386/i686/mempcpy.S: Likewise.
	* sysdeps/i386/i686/memset.S: Likewise.

	* sysdeps/i386/stpcpy.S: Likewise.
	* sysdeps/i386/stpncpy.S: Likewise.
	* sysdeps/i386/strchr.S: Likewise.
	* sysdeps/i386/strchrnul.S: Likewise.
	* sysdeps/i386/strcspn.S: Likewise.
	* sysdeps/i386/strpbrk.S: Likewise.
	* sysdeps/i386/strrchr.S: Likewise.
	* sysdeps/i386/strspn.S: Likewise.
	* sysdeps/i386/strtok.S: Likewise.
	* sysdeps/i386/strtok_r.S: Likewise.
	* sysdeps/i386/i486/strcat.S: Likewise.
	* sysdeps/i386/i486/strlen.S: Likewise.
	* sysdeps/i386/i586/strchr.S: Likewise.
	* sysdeps/i386/i586/strcpy.S: Likewise.
	* sysdeps/i386/i586/strlen.S: Likewise.
	* sysdeps/i386/i686/strcmp.S: Likewise.
	* sysdeps/i386/i686/strtok.S: Likewise.
	* sysdeps/i386/i686/strtok_r.S: Likewise.

	* sysdeps/i386/fpu/fegetenv.c: Wrap symbol names with BP_SYM ().
	* sysdeps/i386/fpu/fesetenv.c: Likewise.
	* sysdeps/i386/fpu/feupdateenv.c: Likewise.
	* sysdeps/i386/fpu/fgetexcptflg.c: Likewise.
	* sysdeps/i386/fpu/fsetexcptflg.c: Likewise.
	* sysdeps/i386/add_n.S: Wrap entry-point symbol in BP_SYM ().
	Check bounds of arguments.
	* sysdeps/i386/addmul_1.S: Likewise.
	* sysdeps/i386/lshift.S: Likewise.
	* sysdeps/i386/mul_1.S: Likewise.
	* sysdeps/i386/rshift.S: Likewise.
	* sysdeps/i386/sub_n.S: Likewise.
	* sysdeps/i386/submul_1.S: Likewise.
	* sysdeps/i386/i586/add_n.S: Likewise.
	* sysdeps/i386/i586/addmul_1.S: Likewise.
	* sysdeps/i386/i586/lshift.S: Likewise.
	* sysdeps/i386/i586/rshift.S: Likewise.
	* sysdeps/i386/i586/sub_n.S: Likewise.
	* sysdeps/i386/i686/add_n.S: Likewise.

	* sysdeps/i386/memchr.S: Likewise.
	* sysdeps/i386/memcmp.S: Likewise.
	* sysdeps/i386/rawmemchr.S: Likewise.
	* sysdeps/i386/i586/bzero.S: Likewise.
	* sysdeps/i386/i586/memcpy.S: Likewise.
	* sysdeps/i386/i586/mempcpy.S: Likewise.
	* sysdeps/i386/i586/memset.S: Likewise.
	* sysdeps/i386/i686/bzero.S: Likewise.
	* sysdeps/i386/i686/memcpy.S: Likewise.
	* sysdeps/i386/i686/mempcpy.S: Likewise.
	* sysdeps/i386/i686/memset.S: Likewise.

	* sysdeps/i386/stpcpy.S: Likewise.
	* sysdeps/i386/stpncpy.S: Likewise.
	* sysdeps/i386/strchr.S: Likewise.
	* sysdeps/i386/strchrnul.S: Likewise.
	* sysdeps/i386/strcspn.S: Likewise.
	* sysdeps/i386/strpbrk.S: Likewise.
	* sysdeps/i386/strrchr.S: Likewise.
	* sysdeps/i386/strspn.S: Likewise.
	* sysdeps/i386/strtok.S: Likewise.
	* sysdeps/i386/strtok_r.S: Likewise.
	* sysdeps/i386/i486/strcat.S: Likewise.
	* sysdeps/i386/i486/strlen.S: Likewise.
	* sysdeps/i386/i586/strchr.S: Likewise.
	* sysdeps/i386/i586/strcpy.S: Likewise.
	* sysdeps/i386/i586/strlen.S: Likewise.
	* sysdeps/i386/i686/strcmp.S: Likewise.
	* sysdeps/i386/i686/strtok.S: Likewise.
	* sysdeps/i386/i686/strtok_r.S: Likewise.

	* sysdeps/i386/fpu/fegetenv.c: Wrap symbol names with BP_SYM ().
	* sysdeps/i386/fpu/fesetenv.c: Likewise.
	* sysdeps/i386/fpu/feupdateenv.c: Likewise.
	* sysdeps/i386/fpu/fgetexcptflg.c: Likewise.
	* sysdeps/i386/fpu/fsetexcptflg.c: Likewise.
Diffstat (limited to 'sysdeps/i386/strchr.S')
-rw-r--r--sysdeps/i386/strchr.S16
1 files changed, 11 insertions, 5 deletions
diff --git a/sysdeps/i386/strchr.S b/sysdeps/i386/strchr.S
index 0bb28bc9be..eeefd04998 100644
--- a/sysdeps/i386/strchr.S
+++ b/sysdeps/i386/strchr.S
@@ -22,6 +22,7 @@
 
 #include <sysdep.h>
 #include "asm-syntax.h"
+#include "bp-sym.h"
 #include "bp-asm.h"
 
 #define PARMS	LINKAGE+4		/* space for 1 saved reg */
@@ -30,12 +31,13 @@
 #define CHR	STR+PTR_SIZE
 
 	.text
-ENTRY (strchr)
+ENTRY (BP_SYM (strchr))
 	ENTER
 
 	pushl %edi		/* Save callee-safe registers used here.  */
 	movl STR(%esp), %eax
 	movl CHR(%esp), %edx
+	CHECK_BOUNDS_LOW (%eax, STR(%esp))
 
 	/* At the moment %edx contains C.  What we need for the
 	   algorithm is C in all bytes of the dword.  Avoid
@@ -239,7 +241,8 @@ L(11):	movl (%eax), %ecx	/* get word (= 4 bytes) in question */
 	jz L(1)			/* no NUL found => restart loop */
 
 L(2):	/* Return NULL.  */
-	xorl %eax, %eax		/* load NULL in return value register */
+	xorl %eax, %eax
+	RETURN_NULL_BOUNDED_POINTER
 	popl %edi		/* restore saved register content */
 
 	LEAVE
@@ -274,10 +277,13 @@ L(7):	testb %cl, %cl		/* is first byte C? */
 	/* It must be in the fourth byte and it cannot be NUL.  */
 	incl %eax
 
-L(6):	popl %edi		/* restore saved register content */
+L(6):
+	CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
+	RETURN_BOUNDED_POINTER (STR(%esp))
+	popl %edi		/* restore saved register content */
 
 	LEAVE
 	RET_PTR
-END (strchr)
+END (BP_SYM (strchr))
 
-weak_alias (strchr, index)
+weak_alias (BP_SYM (strchr), BP_SYM (index))