[Libreoffice-commits] core.git: 3 commits - vcl/opengl vcl/source vcl/unx

Caolán McNamara caolanm at redhat.com
Mon Nov 24 01:39:17 PST 2014


 vcl/opengl/x11/X11DeviceInfo.cxx    |    3 ++-
 vcl/source/opengl/OpenGLContext.cxx |    2 +-
 vcl/unx/glxtest.cxx                 |    2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 24ee4cba937d1b69cb6b5fdb9d1b8116546e5a6e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 24 09:37:18 2014 +0000

    coverity#1255905 Buffer not null terminated
    
    Change-Id: I0822f04a296ec6c8c6ae559aef320a59afc8aa0d

diff --git a/vcl/opengl/x11/X11DeviceInfo.cxx b/vcl/opengl/x11/X11DeviceInfo.cxx
index cc328b0..e7e4b6b 100644
--- a/vcl/opengl/x11/X11DeviceInfo.cxx
+++ b/vcl/opengl/x11/X11DeviceInfo.cxx
@@ -239,7 +239,8 @@ void X11OpenGLDeviceInfo::GetData()
     // read major.minor version numbers of the driver (not to be confused with the OpenGL version)
     if (whereToReadVersionNumbers) {
         // copy into writable buffer, for tokenization
-        strncpy(buf, whereToReadVersionNumbers, buf_size);
+        strncpy(buf, whereToReadVersionNumbers, buf_size-1);
+        buf[buf_size-1] = 0;
         bufptr = buf;
 
         // now try to read major.minor version numbers. In case of failure, gracefully exit: these numbers have
commit 83ea7e76da284be6380fcdadf9848276fcdd080a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 24 09:28:40 2014 +0000

    coverity#1255907 Explicit null dereferenced
    
    Change-Id: I5b7be6698e2028f9b882c2f7deb96739bc968098

diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 46fc097..a93185f 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -549,7 +549,7 @@ GLXFBConfig* getFBConfig(Display* dpy, Window win, int& nBestFBC, bool bUseDoubl
     for(int i = 0; i < fbCount; ++i)
     {
         XVisualInfo* pVi = glXGetVisualFromFBConfig( dpy, pFBC[i] );
-        if(pVi && (!bWithSameVisualID || pVi->visualid == xattr.visual->visualid) )
+        if(pVi && (!bWithSameVisualID || (xattr.visual && pVi->visualid == xattr.visual->visualid)) )
         {
             // pick the one with the most samples per pixel
             int nSampleBuf = 0;
commit 6b7561a87a8c1f99d56da71fa222efb178ffc1aa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Nov 24 09:26:35 2014 +0000

    coverity#1195349 Argument cannot be negative
    
    Change-Id: Id0a8bac3c14e668f066ddcafc84d3397c0d9b74f

diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx
index d1f9591..9e2fba4 100644
--- a/vcl/unx/glxtest.cxx
+++ b/vcl/unx/glxtest.cxx
@@ -106,6 +106,8 @@ void glxtest()
   // any PR logging file descriptors. To that effect, we redirect all positive
   // file descriptors up to what open() returns here. In particular, 1 is stdout and 2 is stderr.
   int fd = open("/dev/null", O_WRONLY);
+  if (fd == -1)
+    fatal_error("could not redirect stdout+stderr");
   for (int i = 1; i < fd; i++)
     dup2(fd, i);
   close(fd);


More information about the Libreoffice-commits mailing list