[PATCH] coverity#705110: out-of-bounds write

Julien Nabet (via Code Review) gerrit at gerrit.libreoffice.org
Fri Mar 1 10:20:52 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2498

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/98/2498/1

coverity#705110: out-of-bounds write

Change-Id: I0edc69928d57eb9ff03a0004b10ca70e55988e68
---
M sal/osl/unx/file_misc.cxx
1 file changed, 10 insertions(+), 2 deletions(-)



diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index b91d803..adba5f5 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -1021,8 +1021,16 @@
         return nRet;
     }
     else
-        pszLinkContent[ nRet ] = 0;
-
+    {
+        if (nRet != PATH_MAX)
+        {
+           pszLinkContent[ nRet ] = 0;
+        }
+        else
+        {
+           pszLinkContent[PATH_MAX - 1] = 0;
+        }
+    }
     nRet = symlink(pszLinkContent,pszDestFileName);
 
     if ( nRet < 0 )

-- 
To view, visit https://gerrit.libreoffice.org/2498
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0edc69928d57eb9ff03a0004b10ca70e55988e68
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Julien Nabet <serval2412 at yahoo.fr>



More information about the LibreOffice mailing list