summaryrefslogtreecommitdiff
path: root/src/analysis/contents
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-08-15 20:03:47 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-08-15 20:03:47 (GMT)
commit13d12a85fa661c2f331a4ad61ef921d942ce9176 (patch)
treeec1ca1d40b44294daa88da8b6626f920fc4d9f87 /src/analysis/contents
parent852650d335f3366ad2c2416c5cebf56a569be691 (diff)
Checked for out-of-bound data access without triggering integer overflow.
Diffstat (limited to 'src/analysis/contents')
-rw-r--r--src/analysis/contents/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/analysis/contents/file.c b/src/analysis/contents/file.c
index b6cd39c..8b371ab 100644
--- a/src/analysis/contents/file.c
+++ b/src/analysis/contents/file.c
@@ -510,10 +510,10 @@ static bool g_file_content_seek(const GFileContent *content, vmpa2t *addr, phys_
offset = get_phy_addr(addr);
- if (offset == VMPA_NO_PHYSICAL)
+ if (length > get_mrange_length(&content->range))
return false;
- if ((offset + length) > get_mrange_length(&content->range))
+ if (offset > (get_mrange_length(&content->range) - length))
return false;
advance_vmpa(addr, length);