diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/x11/X11DeviceInfo.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/opengl/x11/X11DeviceInfo.cxx b/vcl/opengl/x11/X11DeviceInfo.cxx index cc328b0df7f5..e7e4b6b10849 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 |