Skip to content

Commit 0d533a3

Browse files
authored
Fixed bound on memcpy loop in thumb,arm,aarch64
1 parent 636b3b2 commit 0d533a3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pwnlib/shellcraft/templates/aarch64/memcpy.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ ${memcpy_loop}:
1616
ldrb w3, [x1], #1
1717
strb w3, [x0], #1
1818
subs x2, x2, #1
19-
bge ${memcpy_loop}
19+
bgt ${memcpy_loop}

pwnlib/shellcraft/templates/arm/memcpy.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ ${memcpy_loop}:
1616
ldrb r3, [r1], #1
1717
strb r3, [r0], #1
1818
subs r2, r2, #1
19-
bge ${memcpy_loop}
19+
bgt ${memcpy_loop}

pwnlib/shellcraft/templates/thumb/memcpy.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ ${memcpy_loop}:
1616
ldrb r3, [r1], #1
1717
strb r3, [r4], #1
1818
subs r2, r2, #1
19-
bge ${memcpy_loop}
19+
bgt ${memcpy_loop}

0 commit comments

Comments
 (0)