Fix incorrect handling of overlapping memory areas in bcopy32 syslinux-3.55-pre3
authorH. Peter Anvin <hpa@zytor.com>
Fri, 4 Jan 2008 04:32:11 +0000 (20:32 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 4 Jan 2008 04:32:11 +0000 (20:32 -0800)
bcopy32 had the test for forwards vs. backwards copy backwards, which
of course resulted in disaster when memory areas actually overlapped
themselves.

NEWS
bcopy32.inc

diff --git a/NEWS b/NEWS
index 3ba83ce..13d7197 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,7 +10,10 @@ Changes in 3.55:
          but that MAY be reverted in the future if it causes
          problems.
        * Documentation text files moved to a common "doc" directory;
-         man pages from the Debian project added to the "man" directory.
+         man pages from the Debian project added to the "man"
+         directory.
+       * Correct bug with self-overlapping memory areas when using
+         the shuffle interface.
 
 Changes in 3.54:
        * Add "menu separator", "menu indent", "menu disabled"
index 28b70fa..0f01284 100644 (file)
@@ -135,8 +135,8 @@ bcopy:              push eax
                cmp esi,-1
                je .bzero
 
-               cmp esi,edi             ; If source > destination, we might
-               ja .reverse             ; have to copy backwards
+               cmp esi,edi             ; If source < destination, we might
+               jb .reverse             ; have to copy backwards
 
 .forward:
                mov al,cl               ; Save low bits