Skip to content

Commit

Permalink
core: When checking for DS:SI validity, we're using paragraph units
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H. Peter Anvin committed Feb 21, 2011
1 parent 5c93089 commit 102b58a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 102b58a

Please sign in to comment.