[Libreoffice-commits] core.git: bridges/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sun Dec 6 17:37:39 UTC 2020


 bridges/source/cpp_uno/shared/vtablefactory.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit cca1240fe5884f184af489f5326e96892d1ae975
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sun Dec 6 16:44:40 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sun Dec 6 18:36:55 2020 +0100

    Related tdf#134754: Detect failed mmap on macOS
    
    Change-Id: I21202d25e4851725198c58c29d9820bda00f2b30
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107315
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 52309c6ec617..73dc42ef6dfc 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -85,6 +85,11 @@ extern "C" void * allocExec(
     p = mmap(
         nullptr, n, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON | MAP_JIT, -1,
         0);
+    if (p == MAP_FAILED) {
+        auto const e = errno;
+        SAL_WARN("bridges.osx", "mmap failed with " << e << ", " << strerror(e));
+        p = nullptr;
+    }
 #else
     p = mmap(
         nullptr, n, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1,


More information about the Libreoffice-commits mailing list