diff options
author | Tao Bao <tbao@google.com> | 2015-06-25 14:00:31 -0700 |
---|---|---|
committer | Tao Bao <tbao@google.com> | 2015-06-26 13:48:46 -0700 |
commit | c3dddce205ef44933813394013ee5ef89b63653b (patch) | |
tree | 99f87bd70429254e1b49a39c80055764198e5b5c | |
parent | cb9450e11337700907a7a5ec290902196c74fa9b (diff) | |
download | bootable_recovery-c3dddce205ef44933813394013ee5ef89b63653b.zip bootable_recovery-c3dddce205ef44933813394013ee5ef89b63653b.tar.gz bootable_recovery-c3dddce205ef44933813394013ee5ef89b63653b.tar.bz2 |
More accurate checking for overlapped ranges.
A RangeSet has half-closed half-open bounds. For example, "3,5" contains
blocks 3 and 4. So "3,5" and "5,7" are actually not overlapped.
Bug: 22098085
Change-Id: I362d259f8b5d62478858ad0422b635bc5068698d
(cherry picked from commit c0f56ad76680df555689d4a2397487ef8c16b1a6)
-rw-r--r-- | updater/blockimg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/updater/blockimg.c b/updater/blockimg.c index e184800..1e95f4e 100644 --- a/updater/blockimg.c +++ b/updater/blockimg.c @@ -101,7 +101,7 @@ static int range_overlaps(RangeSet* r1, RangeSet* r2) { r2_0 = r2->pos[j * 2]; r2_1 = r2->pos[j * 2 + 1]; - if (!(r2_0 > r1_1 || r1_0 > r2_1)) { + if (!(r2_0 >= r1_1 || r1_0 >= r2_1)) { return 1; } } |