aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/util.c')
-rw-r--r--bootstrap/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bootstrap/util.c b/bootstrap/util.c
index da838b5..b64485b 100644
--- a/bootstrap/util.c
+++ b/bootstrap/util.c
@@ -112,7 +112,8 @@ eprifileline(struct span span) {
close(fd);
return;
}
- filemmaps[span.fileid] = src = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ // XXX this maybe causes SIGBUS later if we're at last line + no ending newline + st_size multiple of 4096
+ filemmaps[span.fileid] = src = mmap(NULL, st.st_size + 1, PROT_READ, MAP_PRIVATE, fd, 0);
assert(src && src != (void *)-1 && "mmap");
close(fd);
}