aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRene Gollent <anevilyak@gmail.com>2012-07-02 20:17:03 -0400
committerRene Gollent <anevilyak@gmail.com>2012-07-02 20:17:03 -0400
commit7f7b659ec5eb4911c6a62e86af3a379227c3eeb0 (patch)
tree6a0987c4b66bddcd09ff47e9c7622dd2ccc4cc5c
parent29291c8c924ada62bf015aaf70d04616cc2e7314 (diff)
Use safer but slower approach to copying the string.hrev44285
-rw-r--r--src/system/kernel/arch/x86/arch_x86.S7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/system/kernel/arch/x86/arch_x86.S b/src/system/kernel/arch/x86/arch_x86.S
index d5c51507f7..1ebcae0e82 100644
--- a/src/system/kernel/arch/x86/arch_x86.S
+++ b/src/system/kernel/arch/x86/arch_x86.S
@@ -286,9 +286,10 @@ FUNCTION(arch_cpu_user_strlcpy):
cld
.L_user_strlcpy_copy_loop:
/* move data by bytes */
- movsb
- cmpb $0,-1(%esi)
- je .L_user_strlcpy_source_done
+ lodsb
+ stosb
+ test %al,%al
+ jz .L_user_strlcpy_source_done
loop .L_user_strlcpy_copy_loop
/* null terminate string */