summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>2016-09-29 16:08:19 (GMT)
committerJosef Weidendorfer <Josef.Weidendorfer@gmx.de>2016-09-29 16:08:19 (GMT)
commit4e5f940b57ae1089db29e0700d30cc309cf27805 (patch)
tree73e418dc7dacccbeda94935d2df2ab276794196d
parentbb89224ede1815befa9ae12a5d99b24be214e4bc (diff)
Fix for bug 368751
We eventually accessed a byte after the memory-mapped input file. If input file size is a multiple of 4096, this could (and did) result in a crash/segfault.
-rw-r--r--libcore/utils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcore/utils.cpp b/libcore/utils.cpp
index 9cafc29..46a0f91 100644
--- a/libcore/utils.cpp
+++ b/libcore/utils.cpp
@@ -436,7 +436,7 @@ bool FixFile::nextLine(FixString& str)
if ((len>0) && (*(current-1) == '\r')) len--;
str.set(_current, len);
- if (*current == '\n') {
+ if ((left > 0) && (*current == '\n')) {
current++;
left--;
}