summaryrefslogtreecommitdiff
path: root/src/format
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-03-20 19:57:34 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-03-20 19:57:34 (GMT)
commit02993e7f7d215ae29a041941d686ceab965d0b97 (patch)
tree0096f1b71f37bbbfd1027eecd1b4dee65e576814 /src/format
parente5bda7574625e43c2576b9457fc2bd89a79aa43d (diff)
Taken the last byte into account when analyzing the string section.
Diffstat (limited to 'src/format')
-rw-r--r--src/format/elf/strings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/format/elf/strings.c b/src/format/elf/strings.c
index 799b8fe..755163e 100644
--- a/src/format/elf/strings.c
+++ b/src/format/elf/strings.c
@@ -186,10 +186,10 @@ bool parse_elf_string_data(GElfFormat *format, phys_t start, phys_t size, virt_t
for (end = i + 1; end < size; end++)
if (!isprint(data[end])) break;
- if (isspace(data[end]) && (end + 1) < size)
+ if (end < size && isspace(data[end]))
end++;
- if (data[end] == '\0' && (end + 1) < size)
+ if (end < size && data[end] == '\0')
end++;
init_vmpa(&pos, start + i, address + i);