summaryrefslogtreecommitdiff
path: root/mmap/unix/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mmap/unix/mmap.c')
-rw-r--r--mmap/unix/mmap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c
index 44cdbedb0..05d3f72ef 100644
--- a/mmap/unix/mmap.c
+++ b/mmap/unix/mmap.c
@@ -83,6 +83,14 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new,
apr_int32_t native_flags = 0;
#endif
+#if APR_HAS_LARGE_FILES && defined(HAVE_MMAP64)
+#define mmap mmap64
+#elif APR_HAS_LARGE_FILES && SIZEOF_OFF_T == 4
+ /* LFS but no mmap64: check for overflow */
+ if ((apr_int64_t)offset + size > INT_MAX)
+ return APR_EINVAL;
+#endif
+
if (size == 0)
return APR_EINVAL;