]> git.proxmox.com Git - grub2.git/commitdiff
* grub-core/commands/loadenv.c (check_blocklists): Fix overlap check.
authorРоман Пехов <roman_pekhov>
Sat, 21 Jun 2014 23:51:50 +0000 (03:51 +0400)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 21 Jun 2014 23:51:50 +0000 (03:51 +0400)
ChangeLog
grub-core/commands/loadenv.c

index 03eedb3ad00a24df475d555751bbb0e3871b917c..be322d48ca576c7e185522477029e565c1f5ada5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-06-21  Роман Пехов <roman_pekhov>
+
+       * grub-core/commands/loadenv.c (check_blocklists): Fix overlap check.
+
 2014-06-21  Glenn Washburn <development@efficientek.com>
 
        * util/grub-install.c: Fix handling of --disk-module.
index 6af8112074563c6532c7116ea249d905ba3b680a..acd93d123ed361e5bd7ae449f5166d5659104823 100644 (file)
@@ -263,7 +263,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
       for (q = p->next; q; q = q->next)
         {
          grub_disk_addr_t s1, s2;
-         grub_disk_addr_t e1, e2, t;
+         grub_disk_addr_t e1, e2;
 
          s1 = p->sector;
          e1 = s1 + ((p->length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
@@ -271,16 +271,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
          s2 = q->sector;
          e2 = s2 + ((q->length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
 
-         if (s2 > s1)
-           {
-             t = s2;
-             s2 = s1;
-             s1 = t;
-             t = e2;
-             e2 = e1;
-             e1 = t;
-           }
-          if (e1 > s2)
+         if (s1 < e2 && s2 < e1)
             {
               /* This might be actually valid, but it is unbelievable that
                  any filesystem makes such a silly allocation.  */