summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-05-24 08:14:00 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-05-24 08:14:00 (GMT)
commite441c2320666df295eaecc385740f40acbd2afbe (patch)
tree153200860196808bd9dda74c5bb7292cd69d3757 /src/glibext
parent337fa0e661abfa999e2b2dbd8161227933220ee3 (diff)
Handled null virtual addresses with more care.
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/gbinportion.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/glibext/gbinportion.c b/src/glibext/gbinportion.c
index ab5fa6e..ff5ff7d 100644
--- a/src/glibext/gbinportion.c
+++ b/src/glibext/gbinportion.c
@@ -1216,14 +1216,17 @@ GBinPortion *g_binary_portion_find_at_pos(GBinPortion *portion, gint x, GdkRecta
static bool g_binary_portion_contains_vmpa(const GBinPortion *portion, const vmpa2t *addr)
{
bool result; /* Bilan à retourner */
+ const mrange_t *range; /* Emplacement de portion */
result = false;
- /* Portion non allouée en mémoire -> adresse nulle ; on écarte */
- if (get_virt_addr(get_mrange_addr(&portion->range)) == 0)
+ range = g_binary_portion_get_range(portion);
+
+ /* Portion non allouée en mémoire : on écarte */
+ if (!has_virt_addr(get_mrange_addr(range)))
goto not_found;
- result = mrange_contains_addr(&portion->range, addr);
+ result = mrange_contains_addr(range, addr);
not_found: