about summary refs log tree commit diff
path: root/sysdeps/i386/i586/strlen.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/i586/strlen.S')
-rw-r--r--sysdeps/i386/i586/strlen.S9
1 files changed, 6 insertions, 3 deletions
diff --git a/sysdeps/i386/i586/strlen.S b/sysdeps/i386/i586/strlen.S
index e2771268ed..6af9da9c41 100644
--- a/sysdeps/i386/i586/strlen.S
+++ b/sysdeps/i386/i586/strlen.S
@@ -21,6 +21,7 @@
 
 #include <sysdep.h>
 #include "asm-syntax.h"
+#include "bp-sym.h"
 #include "bp-asm.h"
 
 /* This version is especially optimized for the i586 (and following?)
@@ -40,10 +41,11 @@
 #define STR	PARMS
 
 	.text
-ENTRY(strlen)
+ENTRY (BP_SYM (strlen))
 	ENTER
 
 	movl STR(%esp), %eax
+	CHECK_BOUNDS_LOW (%eax, STR(%esp))
 	movl $3, %edx		/* load mask (= 3) */
 
 	andl %eax, %edx		/* separate last two bits of address */
@@ -177,9 +179,10 @@ L(3):	subl $4, %eax		/* correct too early pointer increment */
 
 	incl %eax		/* increment pointer */
 
-L(2):	subl STR(%esp), %eax	/* now compute the length as difference
+L(2):	CHECK_BOUNDS_HIGH (%eax, STR(%esp), jb)
+	subl STR(%esp), %eax	/* now compute the length as difference
 				   between start and terminating NUL
 				   character */
 	LEAVE
 	ret
-END (strlen)
+END (BP_SYM (strlen))