[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - 2 commits - vcl/opengl vcl/source

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


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

New commits:
commit 0ee01cf9bae25d47c5201ecabe3208c286581a4b
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
    (cherry picked from commit 24ee4cba937d1b69cb6b5fdb9d1b8116546e5a6e)

diff --git a/vcl/opengl/x11/X11DeviceInfo.cxx b/vcl/opengl/x11/X11DeviceInfo.cxx
index 6899f53..cf04d43 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 7d7d24a472eb72ee13df18d07f5041a4051e9113
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
    (cherry picked from commit 83ea7e76da284be6380fcdadf9848276fcdd080a)

diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index dac3b5c..27f89a3 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -512,7 +512,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;


More information about the Libreoffice-commits mailing list