summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2011-02-20 16:27:18 -0800
committerH. Peter Anvin <hpa@zytor.com>2011-02-20 16:27:18 -0800
commit102b58a9960667208a2f37ca6058b9badad67111 (patch)
tree6c732715b5be7c23ec7cbd313d1c741a6d489e0b
parent5c9308928dad6d68a3a46deab01cfe2177278d60 (diff)
downloadsyslinux-102b58a9960667208a2f37ca6058b9badad67111.tar.gz
core: When checking for DS:SI validity, we're using paragraph unitssyslinux-4.04-pre8
We are comparing DS:SI for a sane range, but we're operating in paragraph units, so the comparison needs to be done that way, too. Reported-by: Keshav P.R. <skodabenz@gmail.com> Debugged-by: Michal Soltys <soltys@ziu.info> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/diskboot.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/diskboot.inc b/core/diskboot.inc
index 7c020667..1be6adef 100644
--- a/core/diskboot.inc
+++ b/core/diskboot.inc
@@ -1,7 +1,7 @@
; -----------------------------------------------------------------------
;
; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
-; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
+; Copyright 2009-2011 Intel Corporation; author: H. Peter Anvin
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
@@ -185,7 +185,7 @@ harddisk:
shr si,4
jz .no_partition ; SI == 0 -> assume no partition
add dx,si
- cmp dx,1024 ; DS:SI < 1K (inside the IVT)?
+ cmp dx,1024 >> 4 ; DS:SI < 1K (inside the IVT)?
jb .no_partition
cmp dx,PartInfo >> 4 ; DS:SI in overwritten memory?
jae .no_partition